我在图片框中有一张图片。我想将该图像作为位图获取。
我的一行代码是:
位图 default_image = (Bitmap)pictureBox5.Image.Clone();
但我得到的是:
default_image value=null;
谁能帮帮我。
最佳答案
Bitmap default_image = new Bitmap(pictureBox5.Image);
您永远不会实例化 Bitmap
,这就是为什么它是 null
。
关于C# 如何从图片框中获取位图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6996987/