hi ol
my name is yasin and am currently working on this application that is an assignment for my diploma.
i am creating the application in vbnet 2003
One of the tasks in the assignment is to capture and save the image on the form. I got this piece of code but the problem is that it was written in vbnet 2005 .

Dim ScreenSize As Size = New Size(My.Computer.Screen.Bounds.Width, My.Computer.Screen.Bounds.Height)
Dim screenGrab As New Bitmap(My.Computer.Screen.Bounds.Width, My.Computer.Screen.Bounds.Height)
Dim g As System.Drawing.Graphics = System.Drawing.Graphics.FromImage(screenGrab)
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
g.CopyFromScreen(New Point(0, 0), New Point(0, 0), ScreenSize)
'screenGrab.Save("C:\screenGrab.bmp")
screenGrab.Save("C:\screenGrab.jpg", System.Drawing.Imaging.ImageFormat.Jpeg)
End Sub

can anyone help as i just started programming in vbnet 2003 a few months ago. dont have much experience.

thank you

I have not used vb 2003 but I think all you have to change is:

My.Computer.Screen.Bounds.Width, My.Computer.Screen.Bounds.Height

to

Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.