Weird mask problem?

BlitzPlus Forums/BlitzPlus Programming/Weird mask problem?

Murilo(Posted 2004) [#1]
All images in my game have a mask colour of green (00FF00). For some strange reason, if I attempt to DrawImage onto an existing image's buffer rather than the BackBuffer, the mask colour isn't transparent!

imgBackground = LoadImage("bg.bmp")
imgSprite = LoadImage("sprite.bmp")

MaskImage imgSprite, 0, 255, 0

SetBuffer ImageBuffer(imgBackground)
DrawImage imgSprite, 100, 100
SetBuffer BackBuffer()
DrawBlock imgBackground, 0, 0
Here's an example of where the green mask is being drawn rather than ignored:



Am I missing something, or is this an issue with Blitz+?

[Edit]
After playing around some more, this problem only appears to exist in full screen with managed images.
[/Edit]


Jimbob(Posted 2004) [#2]
what happens if you draw the background using drawimage?


Murilo(Posted 2004) [#3]
It looks eactly the same as the above image, unless I set the mask to #00FF00 for "imgBackground" of course.

I think this is a bug; DrawBlocking onto another image should create the behaviour shown above (mask is ignored), not DrawImage - It's ignoring the mask.


ford escort(Posted 2004) [#4]
are you in 16 bit or 32 bit display ?
if you are in 16 bit the coulours are not exactly rendered as you drawn them.

there are some code in the code archive to fix this problem

http://www.blitzbasic.com/codearcs/codearcs.php?code=3
http://www.blitzbasic.com/codearcs/codearcs.php?code=182

hope this will help :)