This site is no longer active and is available for archival purposes only. Registration and login is disabled.

Opacity with Color Key


Opacity with Color Key

Postby rsequeira » Aug 12, 2003 @ 12:04pm

Hi all,

I'm stuck with an annoying problem:
I'm blitting a surface with color key, as many others, but I'm trying to do a fade-out effect. By the docs, you could do that simply with a blit with GDBLT_KEYSRC | GDBLT_OPACITY flags, which should do the effect.
My problem is that it seems that GapiDraw is doing the operations in the reverse order: ie. instead of applying opacity AFTER keysrc, it's applying opacity BEFORE keysrc which makes the undesired effect of having the sprite tend to the transparent color (255, 0, 255 in my case, which makes the sprite progressively becoming a pink rectangle) instend of blend with the BG.

Has anyone got any ideas?
Thx in advance.

Ricardo
User avatar
rsequeira
pm Member
 
Posts: 2
Joined: Jan 22, 2003 @ 5:45pm


Postby seb0uille » Aug 13, 2003 @ 1:01am

seb0uille
pm Member
 
Posts: 18
Joined: Aug 4, 2003 @ 3:14pm
Location: Massy, France


Postby rsequeira » Aug 13, 2003 @ 10:34am

The SetColorKey's where in init methods and are working well without the, but I've tried to concentrate the code in one block just to be sure, with the same result. The code is of the uttermost simplicy and should work, so here goes:

RECT clip;
clip.bottom = 100;
clip.left = 0;
clip.right = 10;
clip.top = 0;

GDBLTFX flags;
surface.CreateSurface(GDSURFACE_CLEAR, "test.png");
surface.SetColorKey(RGB(255,0,255));
dst->SetColorKey(RGB(255,0,255));
flags.dwOpacity = 128;

dst->Blt(&clip, &surface, NULL, GDBLT_KEYSRC | GDBLT_OPACITY, &flags);


What I get is the a pink colorized sprite instead of a half opaque key-colored sprite.
Thank you for the attention!
User avatar
rsequeira
pm Member
 
Posts: 2
Joined: Jan 22, 2003 @ 5:45pm


Postby Sm!rk » Aug 13, 2003 @ 7:32pm

User avatar
Sm!rk
pm Member
 
Posts: 172
Joined: Dec 16, 2002 @ 4:40pm


Postby Guest » Aug 14, 2003 @ 12:01am

Guest
 


Postby ppcStudios » Aug 14, 2003 @ 3:02am

G.R. Moore
President/CEO
Pocket PC Studios
www.ppcstudios.com

Image
User avatar
ppcStudios
pm Insider
 
Posts: 744
Joined: Aug 23, 2002 @ 3:53pm
Location: Canfield, Ohio


Return to GapiDraw


Sort


Forum Description

The Cross-platform Graphics SDK for Palms, Pocket PCs, Symbian Devices, and Stationary PCs.

Moderators:

sponge, Johan

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum