1 2 3 4 5 6 7 8 9 10 11 12
| CVSProjectLib.MainVirtualSensorClass vs = new MainVirtualSensorClass();
unsafe
{
bmpData = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb);
bmpData2 = bmp2.LockBits(new Rectangle(0, 0, bmp2.Width, bmp2.Height), ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb);
byte[] buf = new byte[739*563];
Marshal.Copy(bmpData.Scan0, buf, 0, bmp.Height * bmp.Width);
vs.SetImage(buf);
Marshal.Copy((byte[])vs.GetImage(), 0, bmpData.Scan0, 10000);
bmp.UnlockBits(bmpData);
bmp2.UnlockBits(bmpData2);
} |
Partager