【问题标题】:Create Images from existing image and display them in a PictureBox从现有图像创建图像并将它们显示在 PictureBox 中
【发布时间】:2013-09-04 13:05:26
【问题描述】:

我有一个像

Image<Bgr, Byte> ImageFrame = capture.QueryFrame();

(实际上它是一个在 PictureBox 中显示的 Webcam-Stream)

我想从中“提取”单个矩形(坐标已给出)并希望在单独的 PictureBox 中显示这些部分,但目前我有一个心理障碍。

谁能给我一个提示?

【问题讨论】:

  • Winform?吗? ASP.NET?
  • @Christoph 你想选择图像的一个区域并在另一个 PictureBox 中显示该区域吗?

标签: c# image


【解决方案1】:

我假设你正在使用 EmguCV,我还没有测试过这些东西。但这可能会给你一些线索。

  • 使用 EmguCV 提供的 ImageBox 代替 PictureBox。因此不需要任何图像转换。

  • 如果要转换图片,来自EmguCV文档The Image class has a ToBitmap() function that return a Bitmap object, which can easily be displayed on a PictureBox control using Windows Form

  • 现在你会有一个位图,如果你想从这个位图中选择一个特定的区域,那么下面的链接会帮助你。

    crop an image using C#

    How to cut a part of image in C#

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-09-21
    • 2013-04-24
    相关资源
    最近更新 更多