protected void RenderWebcam() { IntPtr ip = IntPtr.Zero; ip = webcam.GetBitmap(); if (ip != IntPtr.Zero) { Bitmap bmp = webcam.IPToBmp(ip); pictureBox1.Image = bmp; freeframe.processFrame(instanceID, ref bmp); label1.Text = freeframe.elapsedTime.ToString() + " msec/frame"; pictureBox2.Image = bmp; System.Runtime.InteropServices.Marshal.FreeCoTaskMem(ip); ip = IntPtr.Zero; pictureBox1.Refresh(); } }