Print screenshot of a Splitcontainer

30 views
Skip to first unread message

JL

unread,
Jul 4, 2009, 8:41:28 PM7/4/09
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
Hi,


I am trying to take a screenshot of the part of a windows form -
Me.SplitContainer1.Panel2- save it to a bitmap, print and it is not
working . Any suggestions how to make it work and what print comment
to print it. Also, do you know if the bitmap is save somewhere on the
harddrive or is it in memory.

Here are my codes

Dim bmpImg As Bitmap = New Bitmap(Me.SplitContainer1.Panel2.Width,
Me.SplitContainer1.Panel2.Height)

Me.SplitContainer1.Panel2.DrawToBitmap(bmpImg, New Rectangle
(0, 0, Me.SplitContainer1.Panel2.Width,
Me.SplitContainer1.Panel2.Height))

bmpImg.Save("SplitPanel.jpg",
System.Drawing.Imaging.ImageFormat.Jpeg)

PrintDocument1.Print()

Thinks for your help.
Reply all
Reply to author
Forward
0 new messages