901020-如何在图像上绘制? [英] 901020 - how to draw on an image?
本文介绍了901020-如何在图像上绘制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在C#中怎么可能?
在C ++中,可以创建一个与窗口DC兼容的位图,并创建一个与窗口DC兼容的dc,称为内存DC,然后在内存dc中选择位图.在选定的位图上进行进一步的图形操作.然后我有一个CBitmap对象,其中包括已制成的形状.
现在在C#中我该怎么做?
目的是将绘制的形状保存到文件中.
thx
解决方案
您可以创建绑定到图像而不是屏幕的System.Drawing.Graphics
对象.使用此Graphics
进行绘制会导致在用于创建它的图像上进行绘制( ^ ]).
hi
i may use Graphics.DrawImage to draw an available Image on a Graphics. but i want to make an Image which is not available by drawing lines, rectangles, texts, etc. on a Graphics.
how is it possible in C#?
in C++, it''s possible to create a bitmap which is compatible with the window DC and creating a compatible dc with the window DC called memory DC and selecting the bitmap in the memory dc. further graphical operations are done on the selected bitmap. then i have a CBitmap object which includes the made shape.
now in C# how can i do that?
the aim is to save a drawn shape to a file.
thx
解决方案
You can create aSystem.Drawing.Graphics
object that is bound to an image instead of the screen. Drawing with thisGraphics
results in drawing on the image you used to create it (System.Drawing.Graphics.FromImage()[^]).
这篇关于901020-如何在图像上绘制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文