Groups | Blog | Home
all groups > dotnet drawing api > march 2008 >

dotnet drawing api : Render user control in an image


mash
3/10/2008 11:31:01 AM
I have a user control which renders some text and also has a child control
that renders an image and other graphics. Is there a way I could get my user
control to draw to an Image. What I want to do is have my User Control added
to a Word document as part of a test report.
So I'd like to have my control and all child controls render to an image
that I could then save and insert into a Word document.
Any ideas or examples?
mash
3/11/2008 2:03:01 PM



[quoted text, click to view]

Yikes...I didn't know about that one. Sometimes it's just a matter of
looking in the right place in the framework. I haven't tried it yet but I'm
guessing that yes the method DrawToBitmap will allow me to um...draw my
control to a bitmap.

Bob Powell [MVP]
3/11/2008 9:47:03 PM
..NET 2.0 on has the new DrawToBitmap method. Does this not work for you?

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.





[quoted text, click to view]
AddThis Social Bookmark Button