png image problem, very newbie question
BlitzMax Forums/BlitzMax Beginners Area/png image problem, very newbie question
| ||
I've got a png image with its background color set to RGB 0, 0, 0. When I try to use the image the images background keeps showing through, why? Below is my Draw method, any help would be greatly appreciated. Thanks ' draw the city Method Draw() SetBlend MASKBLEND SetAlpha 1 SetScale .4, .4 SetRotation 0 DrawImage city, x, y End Method |
| ||
Can't seem to find it now, but I seem to remember that 0,0,0 is the default mask color... try setting a mask of 0,255,0 or some other color that you are unlikely to have used in your images? |
| ||
There should be nothing wrong with what you have done in this part of the program. You have set a few options so it might be a case of not setting them back afterwards (or somewhere else in the program). Try creating a simple program to see whether you have it working with this image... e.g. Graphics 800,600 back = LoadImage("background.png") fore = LoadImage("fore.png") While Not KeyHit(key_escape) Cls DrawImage back,0,0 SetBlend MASKBLEND SetAlpha 1 SetRotation 0 DrawImage fore,100,100 flip Wend |
| ||
umm,.... MASKBLEND lets the background show through, that's what it's for. If you want to show the black pixels use SOLIDBLEND. |
| ||
I found out the problem, I had selected CMYK in photoshop. I changed it to RGB and it worked as it should. Thanks for everyones input. |