Advertisement

can any1 tell why this Blt won't do transparent?

Started by March 02, 2000 06:32 PM
9 comments, last by RangerOne 24 years, 8 months ago
Everyone is right. Support for colorkey colorspaces is hardware only, and spotty.

but here''s a workaround if the appropriate caps are not available:

if your ddcaps show that you can use a colorkey colorspace, just load the image onto a surface as you normally would...

if NOT, load it onto a temporary surface, and set that temporary surfaces colorkey to 253

now, make ANOTHER surface, and fillcolor the entire thing
with 254. blit with transparency from surface 1 to surface 2
all of the 253 will be replaced with 254

set the colorkey of surface2 to 254, and blit from surface 2 to surface 1 with colorkeying. now you will only have 255 instead of 253,254, and 255

copy the contents of surface1 to surface2(no color keying). delete surface1.

this should solve your problem where hardware support is not available, and you wont have to change your images.

another way would just be to lock the surface, and loop through it, replacing 253 and 254 with 255.

Get off my lawn!

This topic is closed to new replies.

Advertisement