If I have a richTextBox and run DrawToBitmap on it, it doesn\'t draw any of the text inside of the richTextBox.
Bitmap b = new Bitmap(rtb.Width, rtb.Height
This thread came up second in Google. Seems to have exactly what you want. Because I imagine you're using this inside your function from this question Accepting Form Elements As Method Arguments?, it's probably best to do something like this.
if(inputControl is RichTextBox)
{
//do specifc magic here
}
else
{
//general case
}
You can check for a Control containing RichTextBox recursively
bool ContainsOrIsRichTextBox(Control inputControl)
{
if(inputControl is RichTextBox) return true;
foreach(Control control in inputControl.Controls)
{
if(ContainsOrIsRichTextBox(control)) return true;
}
return false;
}
I haven't compiled this, and there's a way of doing it without risking a StackOverflowException, but this should get you started.