Posted on October 8th, 2009 by admin
After i added functionality to draw target/rectangle on preview, i received some emails with question how to grab part that exactly in rectagnle.
Ok you dont need anything special and any lib, for example you draw target with
Rect _rect
then to grab that part you need:
1. Grab full image
Bitmap bmp = new Bitmap(width, height);
System.Drawing.Imaging.BitmapData data = bmp.LockBits(new […]
Filed under: Uncategorized | No Comments »
Posted on October 3rd, 2009 by admin
Made some changes in samplegrabber and IGetFrame interface now you can define target position and target type, so new IGetFrame:
[ComVisible(true), ComImport,
Guid("2B21644A-D405-4E27-A51C-A4812bE0CE4C"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IGetFrame
{
[PreserveSig]
int getFrame(IntPtr pBuff);
[PreserveSig]
int getSize([Out] out long size);
[PreserveSig]
int getFrameParams(
[Out] out int width,
[Out] out int height,
[Out] out RawFrameFormat format);
[PreserveSig]
int drawText(
[In] IntPtr ptr,
[In] int height,
[In] int width);
[PreserveSig]
int stopDraw();
[PreserveSig]
int getGrayScale(IntPtr ptr);
[PreserveSig]
int getRgb(IntPtr ptr);
[PreserveSig]
int drawTarget(Rect rect, int type);
[PreserveSig]
int […]
Filed under: Programming | No Comments »