Maskimage() help

Blitz3D Forums/Blitz3D Programming/Maskimage() help

mintybreath(Posted 2007) [#1]
I have a question about maskimage(). I was learning how to use it today, and cant seem to get it to work. I load the image, and set the mask image RGB values, and it never seems to mask the image.

I am not sure if i am using it wrong, or maybe using the program wrong, which i am pretty sure i am not.

Here is the code for the program in case that helps. If anyone could give me some pointers, advice, directions, or help on how to get this to work that would be greatly apreciated.

I feel wierd asking about something that seems sooo simple. :)

Code

Graphics 800,600,16,2
SetBuffer BackBuffer()
AutoMidHandle True
test3=LoadImage("test3.bmp")
back=LoadImage("backt.jpg")
test=LoadImage("test.jpg")
test2=LoadImage("test2.jpg")


While Not KeyDown(1)

DrawImage test3,250,0
DrawImage back,200,0
DrawImage test2,250,0
DrawImage test,200,200

MaskImage test3,19,48,244
MaskImage test,255,5,5
MaskImage test2,255,5,5


Flip

Wend

End



Vertigo(Posted 2007) [#2]
Um yeah... For one use one mask color for the whole thing as a suggestion... and I personally use either 255,0,255 or 0,255,255 which is either bright pink or bright teal...

Next

test=Loadimage("my_image.bmp")
MaskImage test,255,0,255;for pink
MaskImage test,0,255,255;if teal whatever you choose only do one.

next

while keydown(1) = false

drawimage text,x,y

flip
wend

dont call your mask image commands during the loop, call them directly after load time.

-Scott


Matty(Posted 2007) [#3]
Usually jpgs are a bad idea for images with a mask...if you need compressed images with a mask then use png images.


mintybreath(Posted 2007) [#4]
Oh ok, Ill try those suggestions. Thank you
-Kevin