Pixmap color

BlitzMax Forums/BlitzMax Beginners Area/Pixmap color

gameshastra(Posted 2007) [#1]
Is there any possibilty to set/reset the color of the pixmap. I have tried to draw a white colored rectangle after the pixmap. i.e. infront of the pixmap. But its not working properly.


Brucey(Posted 2007) [#2]
ClearPixels( pixmap:TPixmap,argb=0 )

or

pixmap.ClearPixels( argb )


gameshastra(Posted 2007) [#3]
These commands are not working. It says "Clearpixel" not found. I think i have to include Brucey's module. Any other idea.....? Thank you.


GfK(Posted 2007) [#4]
ClearPixels() works fine - I just checked it.


Brucey(Posted 2007) [#5]
Ah... you need to do a "Syncmods". It is available in the latest code.

You can syncmods from the IDE.


tonyg(Posted 2007) [#6]
It says "Clearpixel" not found


If it *really* says 'clearpixel not found' then you have missed off the 's' from clearpixelS.

<EDIT>
This might help :
Graphics 800 , 600
Local mypix:tpixmap = LoadPixmap("max.png")
DrawPixmap mypix , 0 , 0
tg_clearpixels(mypix,255,255,255)
DrawPixmap mypix , 300 , 0
Flip
WaitKey()
Function tg_clearpixels(mypix:tpixmap , red:Int , green:Int , blue:Int)
	Local argb:Int=intcolor(red,green,blue)
	mypix.clearpixels(argb)
End Function
Function IntColor(R,G,B,A=0)
     Return A Shl 24 | R Shl 16 | G Shl 8 | B Shl 0
End Function