User Name Password Register
DaniWeb IT Discussion Community
All
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
Reply
Join Date: Oct 2007
Posts: 1
Reputation: Yasin786 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Yasin786 Yasin786 is offline Offline
Newbie Poster

Capture and save vb.NET form

  #1  
Oct 26th, 2007
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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Dec 2002
Location: West Virginia
Posts: 405
Reputation: waynespangler is on a distinguished road 
Rep Power: 6
Solved Threads: 43
waynespangler waynespangler is offline Offline
Posting Pro in Training

Re: Capture and save vb.NET form

  #2  
Oct 26th, 2007
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
Wayne

It is hard to understand how a cemetery can raise its burial rates and blame it on the cost of living.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb VB.NET Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the VB.NET Forum

All times are GMT -4. The time now is 6:18 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC