public static SUBACQERR copydib(ref SUBACQ_COPYDIB param) { if (!isAvailable()) { return(SUBACQERR.NO_DLL); } return(subacq_copydib(ref param)); }
public static SUBACQERR copydib(ref Bitmap bitmap, DCAMBUF_FRAME src, ref Rectangle rect, int lutmax, int lutmin) { int w = rect.Width; int h = rect.Height; if (w > bitmap.Width) { w = bitmap.Width; } if (h > bitmap.Height) { h = bitmap.Height; } if (w > src.width) { w = src.width; } if (h > src.height) { h = src.height; } BitmapData dst = bitmap.LockBits(rect, ImageLockMode.ReadWrite, PixelFormat.Format32bppRgb); SUBACQ_COPYDIB param = new SUBACQ_COPYDIB(); param.size = Marshal.SizeOf(typeof(SUBACQ_COPYDIB)); param.option = 0; param.src = src.buf; param.srcrowbytes = src.rowbytes; param.srcpixeltype = src.type; param.dst = dst.Scan0; param.dstrowbytes = dst.Stride; param.dstpixelformat = dst.PixelFormat; param.width = w; param.height = h; param.left = rect.Left; param.top = rect.Top; param.lut = IntPtr.Zero; param.lutmax = lutmax; param.lutmin = lutmin; // ---- call subacq4_copydib function in subacq4.dll ---- SUBACQERR err = subacqdll.copydib(ref param); bitmap.UnlockBits(dst); return(err); }
public static extern SUBACQERR subacq_copydib(ref SUBACQ_COPYDIB param);