Well I've tried to grab the stream from the IVideoWindow object in my application but to no avail. The only thing left is to grab a snapshot of the window control itself.
(If anyone can acutally manage to grab the stream please let me know!)
So I am left with this approach:
public virtual Bitmap CaptureControl( Control window )
{
Rectangle rect = window.RectangleToScreen( window.DisplayRectangle );
return capture(window, rect);
}
private Bitmap capture(Control window, Rectangle rect)
{
Bitmap memoryImage = null;
try
{
using (Graphics graphics = window.CreateGraphics())
{
memoryImage = new Bitmap(rect.Width, rect.Height, graphics);
using (Graphics memoryGraphics = Graphics.FromImage(memoryImage))
{
memoryGraphics .CopyFromScreen(rect.X, rect.Y, 0, 0, rect.Size, CopyPixelOperation.SourceCopy);
}
}
}
catch (Exception ex)
{
MessageBox.Show("Capture failed");
}
return memoryImage;
}
Programming solutions, source code, solutions to tech problems and other tech related stuff.
Wednesday, May 23, 2007
C# Webcam Capture
Labels:
c#,
capture,
IVideoWindow,
RTC,
RTCCORELib,
SIP,
stream,
webcam
Thursday, May 10, 2007
Exception has been thrown by the target of an invocation (c#)
"Exception has been thrown by the target of an invocation"
If you're getting this error, then it might be that your event log is becoming too full
You can clear your event log by going to:
Start -> Administrative Tools -> Event Viewer
If you're getting this error, then it might be that your event log is becoming too full
You can clear your event log by going to:
Start -> Administrative Tools -> Event Viewer
Wednesday, May 02, 2007
Nice Javascript Date Picker
I know there's millions around, but I like this one...
http://www.nsftools.com/tips/DatePickerTest.htm
http://www.nsftools.com/tips/DatePickerTest.htm
Subscribe to:
Posts (Atom)