Forum Discussion
aqAnt
Alumni
13 years ago
Hi Andrew,
The conversion was discussed on Stack Overflow. Here is the working solution:
function Test()
{
var bitmap_source = dotNET.System_Windows.Clipboard.GetImage();
var mstream = dotNET.System_IO.MemoryStream.zctor();
var encoder = dotNET.System_Windows_Media_Imaging.BmpBitmapEncoder.zctor();
encoder.Frames.Add(
dotNET.System_Windows_Media_Imaging.BitmapFrame.Create_5(bitmap_source)
);
encoder.Save(mstream);
var image_bitmap = dotNET.System_Drawing.Bitmap.zctor_4(mstream);
var image_graphics = dotNET.System_Drawing.Graphics.FromImage(image_bitmap);
}