在 VB.NET 中,我需要创建一个Image
基于一个Graphics
我有对象。但是,没有诸如此类的方法Image.fromGraphics()
等等。那我该怎么办?
尝试这样的事情MSDN 文章 http://msdn.microsoft.com/en-us/library/ms404307.aspx状态。本质上创建一个Graphics
对象来自Bitmap
。然后使用图形方法执行您需要的操作Image
然后你可以使用Image
你需要如何做。正如 @Damien_The_Unknowner 所说,创建图形对象是为了能够在另一个对象上绘图,它没有要复制的图像,而是创建它的对象。
来自上面的文章:
Dim flag As New Bitmap(200, 100)
Dim flagGraphics As Graphics = Graphics.FromImage(flag)
Dim red As Integer = 0
Dim white As Integer = 11
While white <= 100
flagGraphics.FillRectangle(Brushes.Red, 0, red, 200, 10)
flagGraphics.FillRectangle(Brushes.White, 0, white, 200, 10)
red += 20
white += 20
End While
pictureBox1.Image = flag
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)