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

问题描述

我需要在图像上编写RTF ...我查看了这篇文章 - [C#] RTF文本到位图图像?任何简单的方法? 这是我正在寻找的绝对解决方案,但当我尝试调用

g.DrawRtfText(rtfStr, new RectangleF(0,0,bmp.Width,bmp.Height),1f);



在将文本写入图像文件时修剪文本。



无论如何都要将完整的文字放入此图片中。这是代码,它可能有助于了解我想要实现的目标。



string rtfStr =((System.Windows.Forms.RichTextBox)(printingEditor))。Rtf;

位图bmp = new Bitmap(1400,1800);



图形g = Graphics.FromImage(bmp);

g.DrawRtfText(rtfStr,new RectangleF(0,0,bmp.Width,bmp.Height) ),2f);



string file = Path.Combine(path1,id.ToString()+.tif);

bmp.Save(file);

I need to write RTF on an image... I checked out this article- [C#] RTF text to bitmap image? Any easy way around? and it was the absolute solution I was looking for but I cant figure out one thing when I try to call the
g.DrawRtfText(rtfStr, new RectangleF(0, 0, bmp.Width, bmp.Height), 1f);

It trims the text while writing it to image file.

Is there anyway to fit the complete text into this image.Here is the code, it might help to see what I am trying to achieve.

string rtfStr = ((System.Windows.Forms.RichTextBox)(printingEditor)).Rtf;
Bitmap bmp = new Bitmap(1400, 1800);

Graphics g = Graphics.FromImage(bmp);
g.DrawRtfText(rtfStr, new RectangleF(0, 0, bmp.Width, bmp.Height), 2f);

string file = Path.Combine(path1, id.ToString() + ".tif");
bmp.Save(file);

推荐答案


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

09-05 15:22