I am pasting an image (PNG with transparency) from clipboard:
Dim oDataObj As IDataObject = System.Windows.Forms.Clipboard.GetDataObject()
Dim oImgObj As Image = oDataObj.GetData(DataFormats.Bitmap, True)
oImgObj.Save(temp_local, System.Drawing.Imaging.ImageFormat.Png)
or in C#
IDataObject oDataObj = System.Windows.Forms.Clipboard.GetDataObject();
Image oImgObj = oDataObj.GetData(DataFormats.Bitmap, true);
oImgObj.Save(temp_local, System.Drawing.Imaging.ImageFormat.Png);
The problem is the transparency of image is being lost.
Is there any way to keep image transparency?