Dim mcolor As Boolean
Dim img0 As Emgu.CV.Image(Of Bgr, Byte)
Dim img1 As Emgu.CV.Image(Of Gray, Byte)
If mcolor Then
img0 = New Emgu.CV.Image(Of Bgr, Byte)(mwidth, mheight)
Else
img1 = New Emgu.CV.Image(Of Gray, Byte)(mwidth, mheight)
End If
ptr(0) = IIf(mcolor, img0, img1).MIplImage.imageData.ToInt32 'Emgu CV Image 影像資料位置
ptr(1) = pBuffer '影像資料位置
CopyMemory(ptr(0), ptr(1), mwidth * mheight * IIf(mcolor, 3, 1))
PictureBox1.Image = IIf(mcolor, img0, img1).Bitmap
Dim img0 As Emgu.CV.Image(Of Bgr, Byte)
Dim img1 As Emgu.CV.Image(Of Gray, Byte)
If mcolor Then
img0 = New Emgu.CV.Image(Of Bgr, Byte)(mwidth, mheight)
Else
img1 = New Emgu.CV.Image(Of Gray, Byte)(mwidth, mheight)
End If
ptr(0) = IIf(mcolor, img0, img1).MIplImage.imageData.ToInt32 'Emgu CV Image 影像資料位置
ptr(1) = pBuffer '影像資料位置
CopyMemory(ptr(0), ptr(1), mwidth * mheight * IIf(mcolor, 3, 1))
PictureBox1.Image = IIf(mcolor, img0, img1).Bitmap