简体   繁体   English

如何直接从程序中访问图像数据 window

[英]How to access image data directly from a program window

Through c# language and WinForm How to access image data directly from the in a program window instead of calling a screenshot API like copyfromscreen?通过c#语言和WinForm如何在程序window中直接访问图像数据而不是像copyfromscreen那样调用截图API? Finally, i need to get an image object最后,我需要得到一张图片 object

Something like this?是这样的吗?

using System.Drawing;

private void DemonstratePropertyItem(PaintEventArgs e)
{

    // Create two images.
    Image image1 = Image.FromFile("c:\\FakePhoto1.jpg");
    Image image2 = Image.FromFile("c:\\FakePhoto2.jpg");

    // Get a PropertyItem from image1.
    PropertyItem propItem = image1.GetPropertyItem(20624);

    // Change the ID of the PropertyItem.
    propItem.Id = 20625;

    // Set the PropertyItem for image2.
    image2.SetPropertyItem(propItem);

    // Draw the image.
    e.Graphics.DrawImage(image2, 20.0F, 20.0F);
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM