Saving a Control's Graphic Content to a Bitmap
-
I'm trying to make a control paint itself to a bitmap and save it. I'm trying to do this by making the control paint itself to my graphics object and not by screen capturing and coping. I have had a success with button and label for example. I override the class (ex. button) and made a SaveGraphics method which initialized a bitmap and called the OnPaint method with the bitmap's graphics object. I've had less success with a TextBox or UserControl. In a UserControl, I can call each control with InvokePaint but that still does not work for a TextBox. In overriding a TextBox, calling OnPaint method does not render the text. Anyone have an idea on how to save a TextBox's graphics content to a Bitmap? -- modified at 4:13 Friday 10th March, 2006
-
I'm trying to make a control paint itself to a bitmap and save it. I'm trying to do this by making the control paint itself to my graphics object and not by screen capturing and coping. I have had a success with button and label for example. I override the class (ex. button) and made a SaveGraphics method which initialized a bitmap and called the OnPaint method with the bitmap's graphics object. I've had less success with a TextBox or UserControl. In a UserControl, I can call each control with InvokePaint but that still does not work for a TextBox. In overriding a TextBox, calling OnPaint method does not render the text. Anyone have an idea on how to save a TextBox's graphics content to a Bitmap? -- modified at 4:13 Friday 10th March, 2006
Question asked, Answer given... I looked a bit and found those here: http://www.codeproject.com/cs/miscctrl/alphablendtextbox.asp http://www.thecodeproject.com/cs/miscctrl/AlphaBlendedTextControls.asp If I'l succeed I will post another answer.