MaskImage Broken In Vista?
BlitzPlus Forums/BlitzPlus Programming/MaskImage Broken In Vista?
| ||
The MaskImage function appears to be broken in Windows Vista. DrawImage always draws the masked area of the image regardless of the mask colour used. It seems to be working ok in Blitz3D, but not in BlitzPlus. Can anyone please confirm the problem? |
| ||
I have run blitzplus exe files on vista and it worked fine, check your software, make sure you have a recent update. |
| ||
Define worked fine. Are the images being masked correctly? I don't recall noticing the problem on Vista with an ATI GPU, only on an nVidia GPU. It might be a vendor driver issue. |
| ||
By 'fine' I mean that the masking was correct. |
| ||
Ok thanks |
| ||
Do know of a way to fix this error on Vista? |
| ||
Heh, so it is an error now then? ;) I fixed it by masking the images manually, using ReadPixelFast/WritePixelFast and skipping the pixels with the mask colour information. There was no noticable difference in performance using the above workaround, although it depends on how much you're using it per frame. |
| ||
I assume that it is an error, and it could be a problem for the current games, and for me the update would take to long, because of my progress. |
| ||
VIP3R can you post an example of how you fixed the mask image error, I recently upgraded my computer to vista and I am receiving the same error. |
| ||
Here you go...maskcolour=$FF000000 ; (Black) imgwidth=ImageWidth(sourceimage) imgheight=ImageHeight(sourceimage) LockBuffer ImageBuffer(sourceimage) LockBuffer BackBuffer() For y=0 To imgheight-1 For x=0 To imgwidth-1 rgb=ReadPixelFast(x,y,ImageBuffer(sourceimage)) If rgb<>maskcolour Then WritePixelFast(x,y,rgb,BackBuffer()) Next Next UnlockBuffer ImageBuffer(sourceimage) UnlockBuffer BackBuffer() |
| ||
So now you're drawing your sprites using WPF instead of DrawSprite? o_O |
| ||
I wonder if it is a drivers problem ; some VISTA users haven't got this mask broken... |
| ||
In a fullscreen graphics mode, maskimage is not broken. |
| ||
I wrote this to fix the problem. http://blitzbasic.com/codearcs/codearcs.php?code=2112 |
| ||
So now you're drawing your sprites using WPF instead of DrawSprite? o_O It's a workaround FFS, MaskImage doesn't work correctly in Vista on some video cards. You got any better suggestions? |