怎么让PictureBox拍的相片居中
有高手帮助一下吧...代码如下:
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;
}
拍照的相片偏移了,怎么让它居中了 --------------------编程问答-------------------- 0x435
0x432
...
天知道是什么,不要胡乱反编译一个代码,再找个苦力帮你完善下就等着拿程序领钞票了。 --------------------编程问答-------------------- 用得着这么麻烦么... 直接
PicrtueBox1.SizeMode = zoom不就得了 --------------------编程问答-------------------- 没有用的我设置是这样,当是用pictureBox1拍出来的相片偏移了,不居中
补充:.NET技术 , C#