if (SystemState.CameraPresent)
{
CameraCaptureDialog dlg = new CameraCaptureDialog();
dlg.InitialDirectory = "\\";
dlg.Resolution = new Size(1024, 768);
dlg.StillQuality = CameraCaptureStillQuality.High;
if (dlg.ShowDialog() == DialogResult.OK)
{
picPhoto.Image = new Bitmap(dlg.FileName);
MessageBox.Show("Photo at " + dlg.FileName);
}
}
else
{
MessageBox.Show("Camera not found");
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if (SystemState.CameraPresent)
{
CameraCaptureDialog dlg = new CameraCaptureDialog();
if (dlg.ShowDialog() == DialogResult.OK)
{
picPhoto.Image = new Bitmap(dlg.FileName);
MessageBox.Show("Photo at " + dlg.FileName);
}
}
else
{
MessageBox.Show("Camera not found");
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Microsoft.WindowsMobile;
using Microsoft.WindowsMobile.Status;
using Microsoft.WindowsMobile.Forms;
namespace CameraDetectCS
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void btnPhoto_Click(object sender, EventArgs e)
{
if (SystemState.CameraPresent)
{
CameraCaptureDialog dlg = new CameraCaptureDialog();
if (dlg.ShowDialog() == DialogResult.OK)
{
picPhoto.Image = new Bitmap(dlg.FileName);
MessageBox.Show("Photo at " + dlg.FileName);
}
}
else
{
MessageBox.Show("Camera not found");
}
}
}
}
- Jan 23 Sat 2010 14:50
呼叫.netCF3.5拍照API
close
全站熱搜
留言列表
禁止留言