我正在使用表达式编码器4中的样本来捕获监视器。这一切都很好,但我想捕获辅助监视器。有谁知道如何改变这个?
// Starts new job for preview window
job = new LiveJob();
// Aquires audio and video devices
Collection<EncoderDevice> devices = EncoderDevices.FindDevices(EncoderDeviceType.Video);
EncoderDevice video = devices.Count > 0 ? devices[0] : null;
for (int i = 1; i < devices.Count; ++i)
devices[i].Dispose();
devices.Clear();
devices = EncoderDevices.FindDevices(EncoderDeviceType.Audio);
EncoderDevice audio = devices.Count > 0 ? devices[0] : null;
for (int i = 1; i < devices.Count; ++i)
devices[i].Dispose();
devices.Clear();
// Checks for a/v devices
if (video != null && audio != null)
{
// Create a new device source. We use the first audio and video devices on the system
deviceSource = job.AddDeviceSource(video, audio);
// Make this source the active one
job.ActivateSource(deviceSource);
}
else
{
error = true;
}
由于
编辑:忘记提及它只找到1个视频设备。例如:我不能这样做 EncoderDevice video = devices[1];
答案 0 :(得分:0)
deviceSource.ScreenCaptureSourceProperties = new ScreenCaptureSourceProperties()
{
Left = x,
Top = y,
Width = w,
Height = h,
};