On Wed, 16 Apr 2008 05:02:10 -0700, Peter Morris <mrpmorris at gmail dot
<"com>"wrote :
I have a 200x200 PNG file which has an Alpha layer.
What I would now like is a 200x200 image that is completely black, but
with
the same alpha mask. This is so that I can use it as a drop shadow
behind
the PNG when drawing to a target image.
I cannot see how I can draw to a Graphics without destroying the
Alpha. Any
hints?
I think there's a small chance that setting the Graphics.Compos itingMode
to "over" might be helpful. Perhaps with some pre-initialization of the
target Bitmap into which you're drawing or something. But I haven't
played with it enough to know for sure, and it really depends on what
Microsoft means by "blend".
Other than that, you may have to use Bitmap.LockBits () to get at the
actual image data directly, and then do the conversion yourself
(basically, leave the alpha alone and set the RGB to whatever is
appropriate for your needs...like [0, 0, 0] for a black shadow, for
example.
Pete