Forum Discussion
aqAnt
12 years agoSmartBear Alumni (Retired)
Hi Andrew,
Use the .NET Graphics class that provides the method. For example:
function Test()
{
var image = dotNET.System_Drawing.Image.FromFile("C:\\image.bmp");
var image_graphics = dotNET.System_Drawing.Graphics.FromImage(image);
var black_pen = dotNET.System_Drawing.Pen.zctor(dotNET.System_Drawing.Color.Black);
image_graphics.DrawRectangle(black_pen, 0, 0, 10, 10);
image_graphics.DrawImage(image, dotNET.System_Drawing.Point.zctor(0, 0));
var image_bitmap = dotNET.System_Drawing.Bitmap.zctor_10(image);
var bitmap_source = dotNET.System_Windows_Interop.Imaging.CreateBitmapSourceFromHBitmap(
image_bitmap.GetHbitmap(),
dotNET.System.IntPtr.Zero,
dotNET.System_Windows.Int32Rect.Empty,
dotNET.System_Windows_Media_Imaging.BitmapSizeOptions.FromEmptyOptions()
);
dotNET.System_Windows.Clipboard.SetImage(bitmap_source);
var picture = Sys.Clipboard;
Log.Picture(picture);
}
Related Content
- 4 years agoStrone22
- 11 years agojimpson
- 9 years agotwhitehouse
- 7 years agojuliocesar_nec
Recent Discussions
- 2 days agoMW_Didata