成人午夜激情影院,小视频免费在线观看,国产精品夜夜嗨,欧美日韩精品一区二区在线播放

.Net里一個用于驅動攝像頭的類

2010-08-28 10:45:39來源:西部e網作者:

  本文是借助avicap32.dll庫來驅動攝像頭。做到了抓圖、錄像功能。



  using System;
  using System.Runtime.InteropServices;
  using System.Drawing;
  using System.Drawing.Imaging;

  namespace using System;
  using System.Runtime.InteropServices;
  using System.Drawing;
  using System.Drawing.Imaging;

  namespace PickHead
  {
  /// <summary>
  /// 一個控制攝像頭的類
  /// </summary>
  public class Pick
  {
  private const int WM_USER = 0x400;
  private const int WS_CHILD = 0x40000000;
  private const int WS_VISIBLE = 0x10000000;
  private const int WM_CAP_START = WM_USER;
  private const int WM_CAP_STOP = WM_CAP_START + 68;
  private const int WM_CAP_DRIVER_CONNECT = WM_CAP_START + 10;
  private const int WM_CAP_DRIVER_DISCONNECT = WM_CAP_START + 11;
  private const int WM_CAP_SAVEDIB = WM_CAP_START + 25;
  private const int WM_CAP_GRAB_FRAME = WM_CAP_START + 60;
  private const int WM_CAP_SEQUENCE = WM_CAP_START + 62;
  private const int WM_CAP_FILE_SET_CAPTURE_FILEA = WM_CAP_START + 20;
  private const int WM_CAP_SEQUENCE_NOFILE =WM_CAP_START+ 63;
  private const int WM_CAP_SET_OVERLAY =WM_CAP_START+ 51;
  private const int WM_CAP_SET_PREVIEW =WM_CAP_START+ 50;
  private const int WM_CAP_SET_CALLBACK_VIDEOSTREAM = WM_CAP_START +6;
  private const int WM_CAP_SET_CALLBACK_ERROR=WM_CAP_START +2;
  private const int WM_CAP_SET_CALLBACK_STATUSA= WM_CAP_START +3;
  private const int WM_CAP_SET_CALLBACK_FRAME= WM_CAP_START +5;
  private const int WM_CAP_SET_SCALE=WM_CAP_START+ 53;
  private const int WM_CAP_SET_PREVIEWRATE=WM_CAP_START+ 52;
  private IntPtr hWndC;
  private bool bStat = false;
  
  private IntPtr mControlPtr;
  private int mWidth;
  private int mHeight;
  private int mLeft;
  private int mTop;
  
  /// <summary>
  /// 初始化攝像頭
  /// </summary>
  /// <param name="handle">控件的句柄</param>
  /// <param name="left">開始顯示的左邊距</param>
  /// <param name="top">開始顯示的上邊距</param>
  /// <param name="width">要顯示的寬度</param>
  /// <param name="height">要顯示的長度</param>
  public Pick(IntPtr handle, int left, int top, int width,int height)
  {
  mControlPtr = handle;
  mWidth = width;
  mHeight = height;


關鍵詞:.Net

贊助商鏈接:

主站蜘蛛池模板: 安泽县| 得荣县| 柯坪县| 南靖县| 张家口市| 江阴市| 福泉市| 东方市| 太仆寺旗| 温泉县| 灵寿县| 溧阳市| 阿坝| 九寨沟县| 永仁县| 祁门县| 阆中市| 攀枝花市| 鄂尔多斯市| 内丘县| 崇阳县| 托克托县| 平阴县| 新乐市| 墨竹工卡县| 仁化县| 鲁甸县| 黄石市| 毕节市| 瓮安县| 杭锦旗| 贺州市| 铁岭市| 喀喇| 鸡西市| 长乐市| 黄平县| 五原县| 东丰县| 西乌珠穆沁旗| 东光县|