PDA

View Full Version : Problems with "draw to bitmap"



markuser
October 15, 2015, 13:48:02
Hello,

I would like to take a screenshot of my livestream.
The image is saved, but it doesn't show my livestream. All I see is only a black part where the livestream should be.

My code:

Rectangle rec = new Rectangle(0,0,800,800);
Bitmap bmp = new Bitmap(icImagingControl1.Width, icImagingControl1.Height);
icImagingControl1.DrawToBitmap(bmp, rec) ;
Globals.strPath = Path.GetTempPath();
Globals.strPath = Globals.strPath + "membuf.bmp";
bmp.Save(Globals.strPath, System.Drawing.Imaging.ImageFormat.Bmp);

It would be grateful when someone can help me!

Markus

Stefan Geissler
October 15, 2015, 17:37:14
It seems, you do not snap an image from the live stream at all.

What about using
icImagingControl1.MemorySnapImage();
icImagingControl1.MemorySaveImage();

Documentation is
http://www.theimagingsource.com/en_US/support/documentation/icimagingcontrol-dotnet/meth_descICImagingControl_MemorySnapImage.htm

http://www.theimagingsource.com/en_US/support/documentation/icimagingcontrol-dotnet/meth_descICImagingControl_MemorySaveImage.htm