|
Who can tell me how to show the transparent sprite? |
sj971059
Member #7,689
August 2006
|
The sprite bitmap has a PINK(255,0,255) bg color, and my backbuff is black,
{"name":"590180","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/4\/b\/4b5f5600e6c03aac9563b9e15118a76a.jpg","w":252,"h":250,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/4\/b\/4b5f5600e6c03aac9563b9e15118a76a"} |
CursedTyrant
Member #7,080
April 2006
|
It doesn't work because you saved the image as a JPEG, which compresses colors, and only the magic pink (255, 0, 255) is transparent in allegro... or black in 8 bpp. At least that's how it looks on the screenshot. Save the image as either a bmp or a png, and it should work fine. --------- |
sj971059
Member #7,689
August 2006
|
NO, the image in the post is just my screen-save, in my program, the sprite image Download attachment..my dat resource file in it. thanks. |
Inphernic
Member #1,111
March 2001
|
Quote: The sprite bitmap has a PINK(255,0,255) bg color Nope. -- |
CursedTyrant
Member #7,080
April 2006
|
I don't think I have the grabber atm, but I can see that it's not pure magic pink, because the top of the image is black, and the rest is not. Did you convert the sprite from a jpg or gif, perhaps? In that case, a solution would be to use MS Paint and paint the background again (preferably using the erase tool). --------- |
sj971059
Member #7,689
August 2006
|
Just Now , I use photoshop7.0 to check the BMP file RGB value and found that some area is (252,2,252) ,some area is (255,0,255), OH, my god...... |
Paul whoknows
Member #5,081
September 2004
|
Don't use antialiasing. ____ "The unlimited potential has been replaced by the concrete reality of what I programmed today." - Jordan Mechner. |
|