Alternatives for PrintForm(VB6) in .Net
I need to find a replacement for Vb6 PrintForm functionality. But i cannot use the Print form component from microsoft.
I found several solutions using the BitBlt API call. But again we are discouraged to use API calls. So if any one can help me out as to how this can be done only using only .net framework functionality it would be appreaciated.
I am not sure as to how the Graphics. DrawImage can be used to replace the BitBlt API. Looking for some guidance as to how to use it to achieve the equvalent of VB6 PrintForm functionality.
[766 byte] By [
C10] at [2008-1-7]
I am already using a PrintDocument.
The sample i am refering is avaiable at the following link.
http://weblogs.asp.net/mschiffer/archive/2004/07/13/181111.aspx
The problem is i don't know a how convert the bitmap image (which holds the screen ) to be converted without using the bitBlt API call so that the print document can print the screen.
On http://msdn2.microsoft.com/en-us/library/aa302340.aspx i found that System.Drawing.Graphics.DrawImage is an alternative for the BitBlt API call... but i am not sure how to use this. This has nearly 30 overloads but i couldn't get any of them to work with the PrintDocument. Any help on how this can be done is appreciated.
C10 at 2007-10-2 >

The issue I am having is that as a policy we are not allowed to use any external components other than those provided by the .Net framework by default. Even using win 32 API calls are discouraged. Otherwise the solution with the API call works as expected and is a simple solution.
I am looking for simple alternative.
C10 at 2007-10-2 >

You can use the Me.DrawToBitmap() method to paint an image of the form to a bitmap. Then the bitmap can be printed using the .Net printing components.
Note that you may need to resize the bitmap to a suitable size so that it fits on the page. If you look up the DrawToBitmap() method in the MSDN library you may find the additional information that you need.