且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

写文本并保存图像

更新时间:2023-12-05 16:10:52

创建此类形状并将文本写入图像是一项可以使用的工作图形。 .NET框架公开了一个 System.Drawing [ ^ ]命名空间,可用于在编程中处理这些类型的问题。



虽然这不是在WPF中使用图形和图像的方式,但是为Windows窗体应用程序更好地定义了System.Drawing命名空间,但是你可以使用它来计算创建简单Ecllipse的常见任务,将文本写入Graphics对象,然后将其保存在文件中。



为了更准确和更符合WPF和XAML标记,你可以去 this [ ^ ] MSDN文档并了解WPF中的图形。
Creating such shapes and writing text to the images is a work that can be done using Graphics. The .NET framework exposes a System.Drawing[^] namespace, which can be used to work with these types of problems in programming.

Although this is not the way of working with Graphics and images in WPF and this System.Drawing namespace is better defined for Windows Forms application, but you can use it to work out the common tasks for creating a simple Ecllipse, Write text to the Graphics object and then save it in a file.

To be more precise and contexual to the WPF and the XAML markup, you can go to this[^] MSDN document and learn about Graphics in WPF.