On Jun 27, 2005, at 8:05 PM, Joel Reymont wrote:
For some reason the dest.Graphics.DrawPicture below does not copy the
mask. I get my picture drawn on a white background. If, on the other
hand, I add an extra DrawPicture for the mask then my shadows are of
non-black color. What's going on here?
You are correct, but this code would only execute if the Depth is less
than 16 (like 8). In which case there is no Mask; or at least I have
not seen a case where an 8-bit image has a Mask. But just in case,
here is the modified code to include the mask:
If source.Depth < 16 Then
// have to fix the picture so that there is an RGBSurface
// so temporarily use dest to hold the new source
dest = NewPicture(source.Width, source.Height, 32)
If Not (source.Mask Is Nil) Then
dest.Mask.Graphics.DrawPicture(source.Mask, 0, 0)
source.Mask.Graphics.ForeColor = &c000000
source.Mask.Graphics.FillRect(0, 0, source.Width, source.Height)
dest.Graphics.DrawPicture(source, 0, 0)
source.Mask.Graphics.DrawPicture(dest.Mask, 0, 0)
Else
dest.Graphics.DrawPicture(source, 0, 0)
End If
source = dest
End If
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|