SetMaskColor issue
BlitzMax Forums/BlitzMax Beginners Area/SetMaskColor issue
| ||
I have a number of small images that I created in photoshop (though I've also opened and saved said images in graphics gale as well) with a mask color of hot pink (255,0,255). I call setmaskcolor(255,0,255) before I load the images and it still shows the pink color when drawn. Yet I have some other images I created in GGale that show just fine. I've verified the color is correct. The images are saved as png, though I've saved them as bmp as well just to test that. No idea what's going on here. |
| ||
hmm. are you using 32-bit images? try: img.SetPixmap(0 , MaskPixmap(LockImage(img) , 255 , 0 , 255) ) right after image is loaded. (img is TImage) example: Global img_Car:TImage = LoadImage("car.png") img_Car.SetPixmap(0 , MaskPixmap(LockImage(img_Car) , 255 , 0 , 255) ) |
| ||
That worked. Don't know WHY that worked as yet but it did indeed work. :D |
| ||
oh... the images are 8 bit color btw. |
| ||
if you look brl.mod/max2d.mod/image.bmx, there is TImage type and SetPixmap Method:Method SetPixmap( index,pixmap:TPixmap ) If (flags & MASKEDIMAGE) And AlphaBitsPerPixel[pixmap.format]=0 pixmap=MaskPixmap( pixmap,mask_r,mask_g,mask_b ) EndIf pixmaps[index]=pixmap seqs[index]=0 frames[index]=Null End Method ^^ "And AlphaBitsPerPixel[pixmap.format]=0" prevents images with alpha channel to be masked (8-bit and 32-bit) |
| ||
Thanks for the info. I'll keep all that in mind. :) |
| ||
Can you have native 8-bit images in Blitz, that take up less video ram than the 32-bit formats? |
| ||
did you set a MASKEDIMAGE flag when you loaded the image with loadimage("image.png",MASKEDIMAGE) ? Last edited 2011 |