有高手帮助一下吧...
代码如下:
private void OpenCapture()
{ int intWidth = this.pictureBox1.Width;
int intHeight = this.pictureBox1.Height;
int intDevice = 0;
string refDevice = intDevice.ToString();
hHwnd = xuyuan.capCreateCaptureWindowA(ref refDevice, 1342177280, -1, 0, 120, 40, this.pictureBox1.Handle.ToInt32(), -30);
if (xuyuan.SendMessage(hHwnd, 0x40a, intDevice, 0) > 0)
{
xuyuan.SendMessage(this.hHwnd, 0x435, -1, 0);
xuyuan.SendMessage(this.hHwnd, 0x434, 0x42, 0);
xuyuan.SendMessage(this.hHwnd, 0x432, -1, 0);
xuyuan.SetWindowPos(this.hHwnd, 1, 0, 0, intWidth, intHeight, 10);
}
else
{
xuyuan.DestroyWindow(this.hHwnd);
}
}
public Image CatchVideo()
{
SendMessage(this.hHwnd, 0x41e, 0, 0);
IDataObject obj1 = Clipboard.GetDataObject();
Image getIma = null;
if (obj1.GetDataPresent(typeof(Bitmap)))
{
Image image1 = (Image)obj1.GetData(typeof(Bitmap));
getIma = image1;
}
return getIma;
}
拍照的相片偏移了,怎么让它居中了
代码如下:
private void OpenCapture()
{ int intWidth = this.pictureBox1.Width;
int intHeight = this.pictureBox1.Height;
int intDevice = 0;
string refDevice = intDevice.ToString();
hHwnd = xuyuan.capCreateCaptureWindowA(ref refDevice, 1342177280, -1, 0, 120, 40, this.pictureBox1.Handle.ToInt32(), -30);
if (xuyuan.SendMessage(hHwnd, 0x40a, intDevice, 0) > 0)
{
xuyuan.SendMessage(this.hHwnd, 0x435, -1, 0);
xuyuan.SendMessage(this.hHwnd, 0x434, 0x42, 0);
xuyuan.SendMessage(this.hHwnd, 0x432, -1, 0);
xuyuan.SetWindowPos(this.hHwnd, 1, 0, 0, intWidth, intHeight, 10);
}
else
{
xuyuan.DestroyWindow(this.hHwnd);
}
}
public Image CatchVideo()
{
SendMessage(this.hHwnd, 0x41e, 0, 0);
IDataObject obj1 = Clipboard.GetDataObject();
Image getIma = null;
if (obj1.GetDataPresent(typeof(Bitmap)))
{
Image image1 = (Image)obj1.GetData(typeof(Bitmap));
getIma = image1;
}
return getIma;
}
拍照的相片偏移了,怎么让它居中了
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货