Esempio n. 1
0
 public void UpdateImage(ref tSdkFrameHead tFrameHead, IntPtr pRgbBuffer)
 {
     SnapshotBox.Width  = tFrameHead.iWidth;
     SnapshotBox.Height = tFrameHead.iHeight;
     SnapshotBox.Image  = MvApi.CSharpImageFromFrame(pRgbBuffer, ref tFrameHead);
     panel1.AutoScroll  = true;
 }
Esempio n. 2
0
        public Bitmap QueryFrame(uint wTimes = 1000)
        {
            tSdkFrameHead tFrameHead;
            IntPtr        uRawBuffer;
            Bitmap        bmFrame = null;

            if (MvApi.CameraSnapToBuffer(m_hCamera, out tFrameHead, out uRawBuffer, 800) == CameraSdkStatus.CAMERA_STATUS_SUCCESS)
            {
                //将相机输出的原始数据转换为RGB格式到内存m_ImageBufferSnapshot中
                MvApi.CameraImageProcess(m_hCamera, uRawBuffer, m_ImageBufferSnapshot, ref tFrameHead);
                MvApi.CameraReleaseImageBuffer(m_hCamera, uRawBuffer);
                Image img = MvApi.CSharpImageFromFrame(m_ImageBufferSnapshot, ref tFrameHead);
                bmFrame = (Bitmap)img;
            }
            return(bmFrame);
        }