如题,如何修改呢,是不是要改dll文件

解决方案 »

  1.   

    源代码我有,可是里面调用了DLL文件,我在源代码中改了半天也不起作用,根本找不到640*480,是不是封装到DLL中了?
      

  2.   

    [DllImport("avicap32.dll", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            public static extern int capCreateCaptureWindowA([MarshalAs(UnmanagedType.VBByRefStr)]   ref   string lpszWindowName, int dwStyle, int x, int y, int nWidth, short nHeight, int hWndParent, int nID);
            [DllImport("avicap32.dll", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            public static extern bool capGetDriverDescriptionA(short wDriver, [MarshalAs(UnmanagedType.VBByRefStr)]   ref   string lpszName, int cbName, [MarshalAs(UnmanagedType.VBByRefStr)]   ref   string lpszVer, int cbVer);
            [DllImport("user32", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            public static extern bool DestroyWindow(int hndw);
            [DllImport("user32", EntryPoint = "SendMessageA", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            public static extern int SendMessage(int hwnd, int wMsg, int wParam, [MarshalAs(UnmanagedType.AsAny)]   object lParam);
            [DllImport("user32", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            public static extern int SetWindowPos(int hwnd, int hWndInsertAfter, int x, int y, int cx, int cy, int wFlags);
            [DllImport("vfw32.dll")]
            public static extern string capVideoStreamCallback(int hwnd, videohdr_tag videohdr_tag);
            [DllImport("vicap32.dll", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
            public static extern bool capSetCallbackOnFrame(int hwnd, string s);
    private void OpenCapture()
            {
                int intWidth = this.panel_Vedio.Width;
                int intHeight = this.panel_Vedio.Height;
                int intDevice = 0;
                string refDevice = intDevice.ToString();
                hHwnd = Frm_Main.capCreateCaptureWindowA(ref   refDevice, 1342177280, 0, 0, 640, 480, this.panel_Vedio.Handle.ToInt32(), 0);
                this.LbSysMsg.Text = "";
                //this.LbSysMsg.Text += "驱动:" + refDevice;
                if (Frm_Main.SendMessage(hHwnd, 0x40a, intDevice, 0) > 0)
                {
                    Frm_Main.SendMessage(this.hHwnd, 0x435, -1, 0);
                    Frm_Main.SendMessage(this.hHwnd, 0x434, 0x42, 0);
                    Frm_Main.SendMessage(this.hHwnd, 0x432, -1, 0);
                    Frm_Main.SetWindowPos(this.hHwnd, 1, 0, 0, intWidth, intHeight, 6);
                    this.BtnCapTure.Enabled = false;
                    this.BtnPhoto.Enabled = true;//拍照可用
                    this.BtnStop.Enabled = true;
                }
                else
                {
                    Frm_Main.DestroyWindow(this.hHwnd);
                    this.BtnCapTure.Enabled = false;
                    this.BtnPhoto.Enabled = false;//拍照不可用
                    this.BtnStop.Enabled = true;
                }
            }
      

  3.   

    hHwnd = Frm_Main.capCreateCaptureWindowA(ref refDevice, 1342177280, 0, 0, 640, 480, this.panel_Vedio.Handle.ToInt32(), 0);640 480
      

  4.   

    是的,没有效果,它拍照好象调用的是dll,无论你设多大,照片始终是640*480