I create an application support copy an image to clip board and parse to pdf, excel or auto card file. I have an issue : copy an image PNG, when parse it loses transparency , it's transparency to be gray Some body help me?
My code :
Bitmap managerStampBitmap = new Bitmap(tc.Path);
using (MemoryStream stream = new MemoryStream())
{
managerStampBitmap = Commons.ResizeImage(managerStampBitmap, 38, 38);
managerStampBitmap.Save(stream, ImageFormat.Png);
System.Windows.Forms.DataObject data = new System.Windows.Forms.DataObject("PNG", stream);
System.Drawing.Image image = System.Drawing.Image.FromStream(stream, true, true);
data.SetImage(image);
System.Windows.Forms.Clipboard.Clear();
System.Windows.Forms.Clipboard.SetDataObject(data, true);
}