gpt4 book ai didi

c# - 如何将 Image 类型转换为 Image

转载 作者:太空宇宙 更新时间:2023-11-03 22:01:36 25 4
gpt4 key购买 nike

知道如何转换 Image输入 Image<Bgr, Byte>类型?

我从 PictureBox 获取图像控件,我需要将其转换为 Image<Bgr, Byte>类型。

Image pictureBoxImage = pictureBox.Image;
Image<Bgr, Byte> image = // ...

最佳答案

根据documentation :

Creating image from Bitmap

It is also possible to create an Image<TColor, TDepth> from a .Net Bitmap object

所以,你应该能够做到:

var image = new Image<Bgr, Byte>(new Bitmap(pictureBox.Image));

关于c# - 如何将 Image 类型转换为 Image<Bgr, Byte>?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12247802/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com