Click here to Skip to main content
15,917,964 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I want to take print screen of my forms through out coding.

Is that possible?

If so please give me some idea's and sample coding.
Posted
Updated 13-Oct-10 23:36pm
v2
Comments
Dalek Dave 14-Oct-10 5:36am    
Edited for Grammar and Readability.

1 solution

Does this help?

VB
' Create a new Bitmap object with the screen bounds
Dim b As Bitmap = New Bitmap(My.Computer.Screen.Bounds.Width,My.Computer.Screen.Bounds.Height, Imaging.PixelFormat.Format32bppArgb)
' Create a Graphics object that will process the screen shot
Dim gfx As Graphics = Graphics.FromImage(b)
' Copy the screen contents
gfx.CopyFromScreen(My.Computer.Screen.Bounds.X,My.Computer.Screen.Bounds.Y, 0, 0, Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy)
' Save the resulting graphics
b.Save("my2.jpg", Imaging.ImageFormat.Jpeg)
 
Share this answer
 
v3
Comments
sameertm 14-Oct-10 5:48am    
wow, its cool answer,, thnks alot..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900