1.多易拍介绍:百度百科:http://baike.baidu.com/view/4320163.htm

2.多易拍,简单实现图片抓拍

前置动作:
  A:安装驱动
  B:vs 引入videochannel control com组建
1.初始化:
初始化:
View Code
this.axVideoChannel1.NISetProperty("InputMode", "3");
this.axVideoChannel1.NISetProperty("SourceFilterName", "NewImage SuperCam");                         
this.axVideoChannel1.NISetProperty("SamplerEnable", "YES");
this.axVideoChannel1.NISetProperty("SealMaskEnable", "YES");
this.axVideoChannel1.NISetProperty("WarpingEffectEnable", "YES");

this.axVideoChannel1.NISetProperty("KeepVideoAspectEnable", "YES");
this.axVideoChannel1.NISetProperty("EnableTargetDPI", "YES");
this.axVideoChannel1.NISetProperty("CameraFOVHeight", "27.1");
this.axVideoChannel1.NISetProperty("CameraFOVWidth", "36.1");
this.axVideoChannel1.EnableMask = true;

this.axVideoChannel1.NISetProperty("CompressFilterName", "default");
this.axVideoChannel1.NISetProperty("SmartTeeEnable", "YES");
this.axVideoChannel1.ROIXRatio = 0.85;
this.axVideoChannel1.ROIXRatio = 0.75;
this.axVideoChannel1.ROIYRatio = 0.75;

this.axVideoChannel1.AllowContextMenu = false;
this.axVideoChannel1.NISetProperty("VideoBackgroundColorRGB", "0,0,0");
this.axVideoChannel1.ColorMode = 117;
this.axVideoChannel1.ColorMode = 119;           
this.axVideoChannel1.ColorMode = 121;

this.axVideoChannel1.ColorMode = 0x00020000 + 25;
this.axVideoChannel1.ColorMode = 101;
this.axVideoChannel1.NISetProperty("Do", "CreateAllFilters");

this.axVideoChannel1.StartPlay();

2.抓拍

View Code
this.axVideoChannel1.EnablePreview = false;
this.axVideoChannel1.AutoFit = false;
this.axVideoChannel1.NISetProperty("MonoNoiseLevel", "0.85");
this.axVideoChannel1.NISetProperty("EnableTargetDPI", "YES");
this.axVideoChannel1.NISetProperty("TargetDPIColor", "200");

this.axVideoChannel1.NISetProperty("TargetDPIMono", "200");
this.axVideoChannel1.ColorMode = 1;
this.axVideoChannel1.DoGrabAndEdit();

 

3.获取文件流:以下几种方法都可以
View Code
this.axVideoChannel1.NIGetProperty("GetResultImageJPEG");
this.axVideoChannel1.NIGetProperty("GetSnapshotJPEG"); 
this.axVideoChannel1.NIGetProperty("GetProcessedSnapshotJPEG");
this.axVideoChannel1.NIGetProperty("GetSnapshot");

4.保存文件 

View Code
this.axVideoChannel1.SaveToFile(string.Format("C://{0}.JPG",DateTime.Now.ToString("yyyyMMddmmss")));

5.停止/关闭

View Code
this.axVideoChannel1.StopPlay();
this.axVideoChannel1.NISetProperty("Do", "DestroyFilterGraph");

 

posted on 2012-05-22 13:33  刚子85  阅读(574)  评论(0编辑  收藏  举报