CameraCaptureDialog

来源:互联网 发布:网络平台贷款是否合法 编辑:程序博客网 时间:2024/04/30 11:45
 

老文章了:

Windows Mobile 5.0 中为开发人员提供的新功能

使用 Windows Mobile 5.0 中的图片、视频和照相机

SelectPictureDialog  图片选择对话框

CameraCaptureDialog  摄像捕捉对话框

State and Notification Broker API

Windows Media Player媒体播放器控件

ChooseContactDialogcontactDialog 

Pocket Outlook ,Phone,SMS,Direct3D等等

windows mobile 5.0提供的新功能真是很强大很方便,ms早就该提供了,哈。
这次利用 CameraCaptureDialog  摄像捕捉对话框和上次说的Gif编码类 AnimatedGifEncoder 写了个小程序,用CameraCaptureDialog  来拍照片,然后把拍到的几张照片合成一张gif图片显示出来。

using Microsoft.WindowsMobile.Forms;
......
CameraCaptureDialog cameraCaptureDialog = new CameraCaptureDialog();
          
cameraCaptureDialog.Owner = this;
           
cameraCaptureDialog.Title = "Take your Photo";
           
cameraCaptureDialog.Mode = CameraCaptureMode.Still;//捕捉图像 
              
if (cameraCaptureDialog.ShowDialog() == DialogResult.OK &&

             cameraCaptureDialog.FileName.Length > 0)
         
{
            //图片路径    cameraCaptureDialog.FileName
            ......    
}
......

记录拍下照片的路径,然后利用AnimatedGifEncoder 合成就可以了。

在手机上运行的还不错,把拍到的照片连成一个gif来看还是挺有意思的,但是要把摄像头的分辨率设低点,不然要是用1600*1200的话,合成gif的时候速度实在是忍受不了唠。

原创粉丝点击