写文本并保存图像 [英] write text and save image

查看:73
本文介绍了写文本并保存图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是wpf的初学者我首先创建了一个程序,我尝试使用Inkcanvas(Ink,GestureOnly,select,...)我的问题是如何在任何形状内写文本(文本不使用Ink)例如椭圆或任何东西,如何将所有窗口保存为图像

Hi,I'm beginner in wpf I make a program this first my attempt to use Inkcanvas(Ink,GestureOnly,select,...) my question is how can I write text(text not use Ink) inside any shape for example Ellipse or any thing and how can I save all the window as image

推荐答案

创建此类形状并将文本写入图像是一项可以使用的工作图形。 .NET框架公开了一个 System.Drawing [< a href =http://msdn.microsoft.com/en-us/library/system.drawing(v=vs.110).aspx\"target =_ blanktitle =New Window> ^ ]命名空间,可用于在编程中处理这些类型的问题。



虽然这不是在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.


这篇关于写文本并保存图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆