【发布时间】:2014-01-03 04:56:36
【问题描述】:
我正在将在 Web 表单中输入的信息写入 tiff 文件。我的问题是评论框在网络表单中发挥作用的地方。注释框是多行的,在将其写入 tiff 文件时,输入到注释框中的一些信息会从 tiff 图像中掉出来。
我如何尝试将其写入 tiff 文件的代码:-
System.Drawing.Bitmap bitmap = new System.Drawing.Bitmap(800, 1000); //Creates Bitmap
Graphics g = Graphics.FromImage(bitmap);
g.DrawString("Comment: " + CommentBox.Text, outputFont, Brushes.Black, new PointF(0, 700)); // Writing the text from the comment box on to the Tiff file.
所以这对我来说意味着,如果我将多行注释写为:-
“你好测试。
你好,一次又一次的测试,一次又一次,一次又一次。
你好,一次又一次的测试,一次又一次,一次又一次。你好,一次又一次的测试,一次又一次,一次又一次。”
我的 tiff 文件仅捕获最大宽度为 1000 的行元素,超出该宽度的元素不会自动生成在新行中。
谁能帮我解决这个问题?想法?
【问题讨论】:
-
CommentBox.DrawToBitmap(...) 会起作用吗?