将RitchTextBox格式化数据转换为Image [英] convert RitchTextBox formated data to Image

查看:87
本文介绍了将RitchTextBox格式化数据转换为Image的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我在ritch文本框中写入数据并应用一些bulate并将其格式化为

那么格式化数据必须转换为具有与ritch文本框相同外观的图像







plz回复我...尽快

thaks ...

if i write data in ritch text box and apply some bulates and formated that
then that formated data must be converted to image with same look like as ritch text box



plz reply me...ASAP
thaks...

推荐答案

我假设您正在使用winforms



这是一段将控件捕获到位图的代码。您将只获得内容的可见部分。



假设'rtf'是您的控制

I assume you are using winforms

Here's a piece of code that captures the control to a bitmap. You'll get only the visible part of the content.

Assuming 'rtf' is your control
rtf.Update();
Bitmap bmp = new Bitmap(rtf.Width, rtf.Height);
using (Graphics g = Graphics.FromImage(bmp)) 
{
    g.CopyFromScreen(rtf.PointToScreen(Point.Empty), Point.Empty, rtf.Size);
}


这篇关于将RitchTextBox格式化数据转换为Image的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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