Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I can crop them easly but the minute I draw it back it becomes opaque :(

Bitmap bitSize = new Bitmap(32, 32);
Image pic = Bitmap.FromFile(sCurrentFile,true);
Graphics g = Graphics.FromImage(bitSize);
g.DrawImage(pic, dstRectangle, srcRectangle, GraphicsUnit.Pixel) ;

 

I really don't know how to make it working, I think when I load the image to the Bitmap object it simply looses its tranparency alpha channel, no?

  • Leaders
Posted
Try explicitly specifying an ARGB format in the Bitmap constructor . If that doesn't work, try setting the compositing mode of the graphics object to CompositingMode.SourceCopy. The default is SourceOver, which performs an alpha blend. SourceCopy copies the alpha data instead of blending it.
[sIGPIC]e[/sIGPIC]

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...