[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] Overwrite color not alpha?
- To: pygame-users@xxxxxxxx
- Subject: Re: [pygame] Overwrite color not alpha?
- From: Brian Fisher <brian@xxxxxxxxxxxxxxxxxxx>
- Date: Sun, 12 Feb 2006 10:57:38 -0800
- Delivered-to: archiver@seul.org
- Delivered-to: pygame-users-outgoing@seul.org
- Delivered-to: pygame-users@seul.org
- Delivery-date: Sun, 12 Feb 2006 13:57:43 -0500
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=WXSmbu/zTcV3BDVf/lZxMPhgPOPQTfC0qEdCuBEzy7TNgZ6ZbSeZDyS4Am5FajYIQSeBGV4Z+lxbjW9b0NS/FIksz+XEzsHG4YZHxQllb938sZOqkQ9eVZg9aIq5d2lfY1lOvY27gMICclO9mHPIZBS5NCdyM3hlwt6Yu5f6T1w=
- In-reply-to: <43EF7986.1020803@comcast.net>
- References: <43EF7986.1020803@comcast.net>
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
SDL has some possibly non-intuitive rules about how to do the blit
ased on whether the SDL_SRCALPHA flag is set on the source and whether
the source and dest are RGB or RGBA. I don't know if you can find that
info in the pygame docs or not (anybody know?) but it is in the SDL
documentation for SDL_SetAlpha
here's a random version of that doc page
http://manuals.thexdershome.com/SDL-1.2.5/html/sdlsetalpha.html
So it looks like what you want is to simply blit RGBA to RGBA with
SDL_SRCALPHA on the source - SDL should be leaving the dest alpha
alone
does that get what you want?
On 2/12/06, Kamilche <klachemin@xxxxxxxxxxx> wrote:
> On an RGBA picture, is there a way to quickly fill the RGB portion while
> leaving the A portion untouched? The only way I know how to do it is
> create a new surface and assign the alpha channel with Numeric, but
> that's awfully slow.
>
> --Kamilche
>
>