How do I make the opacity mask in Compact Framework?
I don't think the CF version of the .NET version supports opacity. Also makes sense. Calculating opacity is a very expensive operation, one of which is not suitable for low-power devices.
This means a possible workaround.
source to share
You can roll your own bitmap opacity mask by simply doing pixel manipulation yourself. Super-slow way to do this would be to use Bitmap methods GetPixel
and SetPixel
, but much faster way - use LockBits method. Cm:
http://www.bobpowell.net/lockingbits.htm
Depending on what you are doing, Windows Mobile devices have incredible processing power for this kind of thing. It only takes a few milliseconds to iterate and process a 76,800 pixel 320x240 bitmap using LockBits (depending on how complex the "processing" is, of course). Opacity masking (presumably) involves just comparing the two pixel values ββand possibly calculating the third, so this is not a problem.
source to share