【发布时间】:2017-06-06 09:17:59
【问题描述】:
我能够得到 picturebox1 的宽度和长度,但是我找不到正确的代码来获取 picturebox1 的 x 和 y 位置,我有已经尝试过以下代码;
job = new ScreenCaptureJob();
System.Drawing.Size area = SystemInformation.WorkingArea.Size;
Rectangle captureRect = new Rectangle(0, 0, pictureBox1.ClientSize.Width -(pictureBox1.ClientSize.Width % 4), pictureBox1.ClientSize.Height - (pictureBox1.ClientSize.Height % 4));
我使用 MEE 的 screencapturejob 来完成录制过程。
【问题讨论】:
-
我使用链接中的此代码,但有消息:名称 picturebox1 在当前上下文中不存在,您知道如何解决此问题吗?
-
我不知道你究竟是如何使用
picturebox1以及它是在哪里定义的,因为你没有向我们展示。但无论如何,这个错误是非常普遍的,归结为试图在不知道该变量/字段的范围内使用变量/字段 - stackoverflow.com/questions/18233630/…。
标签: c# screen picturebox recording