•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the VB.NET section within the Software Development category of DaniWeb, a massive community of 456,577 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,636 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our VB.NET advertiser: Programming Forums
Views: 2748 | Replies: 1
![]() |
•
•
Join Date: Oct 2007
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
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
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
•
•
Join Date: Dec 2002
Location: West Virginia
Posts: 405
Reputation:
Rep Power: 6
Solved Threads: 43
I have not used vb 2003 but I think all you have to change is:
to
My.Computer.Screen.Bounds.Width, My.Computer.Screen.Bounds.Height
Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height
Wayne
It is hard to understand how a cemetery can raise its burial rates and blame it on the cost of living.
It is hard to understand how a cemetery can raise its burial rates and blame it on the cost of living.
![]() |
•
•
•
•
•
•
•
•
DaniWeb VB.NET Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- How to draw a line in a VB.NET form? (VB.NET)
- Printing of a Form in VB.NET? (VB.NET)
- How to Detect Change on ASP.NET Form and Prompt Client to Save (ASP.NET)
- Simple Email Form in ASP.Net (ASP.NET)
- How do I get a form to capture ALL keyboard input? (C#)
- How Would I take A Picture Of My Desktop And Post It At A Forum As An JPG? (Geeks' Lounge)
- Save the values of a form (HTML and CSS)
Other Threads in the VB.NET Forum
- Previous Thread: Newbie needs initial direction - Warehouse inventory program
- Next Thread: How do I activate an HTML Help FIle on Button click ?


Linear Mode