Render Windows Form to graphics object/bitmap

T

Tom

I need to be able to force a form or control to render itself to a graphics
bitmap instead of
(or as well as) the screen device. This is not the same as basic
capture/print screen functionality.
It would almost have to emulate a screen or something... I feel some nifty
APIs would
probably do the trick, but I was hoping for a fully fledged .NET solution.

The only article I have come across that's of any use is this:
http://www.winformreports.co.uk/

The functionality I require is basically this:
"... By hooking into the printing mechanism of the .NET runtime it is
able to draw the
controls on your Windows Form straight to the PrintPreviewDialog or
Printer..."

If anyone has any more thoughts on this please let me know.
Thanks, Tom
 
B

Bob Powell [MVP]

You could capture the window to a bitmap and print the bitmap.

See the GDI+ FAQ for details.

--
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top