Hi,
I'm just wondering if it is possible to create an image from RTF formatted
text?
If it isn't possible, is there anyway of determining the height of an rtf
string for a given width? I have the text in a richtextbox control and would
like to set the height so that all of the text is displayed.
Thanks,
Steve.
Tommy Carlier - 30 Nov 2004 07:41 GMT
> Hi,
>
[quoted text clipped - 8 lines]
>
> Steve.
I don't know how to create an image from RTF, but I do know how to get
the height for a given width. The RichTextBox control has an event
ContentsResized, that is called when the size of the content changes.
The event has an argument of type ContentsResizedEventArgs, that has a
property NewRectangle of type rectangle.
// myRTB is the RichTextBox
myRTB.ContentsResized += new
ContentsResizedEventHandler(myRTB_ContentsResized);
private void myRTB_ContentsResized(object sender,
ContentsResizedEventArgs e)
{
int height = e.NewRectangle.Height; // the new height
}