2 Replies - 367 Views - Last Post: 05 January 2013 - 11:40 PM Rate Topic: -----

#1 xxrhy  Icon User is offline

  • D.I.C Head

Reputation: -1
  • View blog
  • Posts: 51
  • Joined: 08-April 12

screenshots of entire form and save to access db.

Posted 05 January 2013 - 08:34 PM

i was trying to make a screen shot of my working place only but it gets my whole desktop
Sub takescreenshot()
        Try
            Dim Img As New Bitmap(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height)

            Dim g As Graphics = Graphics.FromImage(Img)
            g.CopyFromScreen(0, 0, 0, 0, Img.Size)
            g.Dispose()
             MsgBox("done!")
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End Sub



and i save it to my desktop only using this code
Img.Save("D:\Documents and Settings\Rhy\Desktop\screenshots\myimage.jpg", Imaging.ImageFormat.Jpeg)



i dont know if it is able to insert to my access database?

Is This A Good Question/Topic? 0
  • +

Replies To: screenshots of entire form and save to access db.

#2 lar3ry  Icon User is offline

  • Coding Geezer
  • member icon

Reputation: 310
  • View blog
  • Posts: 1,290
  • Joined: 12-September 12

Re: screenshots of entire form and save to access db.

Posted 05 January 2013 - 10:23 PM

View Postxxrhy, on 05 January 2013 - 09:34 PM, said:

i was trying to make a screen shot of my working place only but it gets my whole desktop

and i save it to my desktop only using this code

i dont know if it is able to insert to my access database?

I don't know about adding it to your database, but you are asking it to copy the entire screen, from the top left corner.

Try this instead:
            Dim Img As New Bitmap(Me.Width, Me.Height)
            Dim g As Graphics = Graphics.FromImage(Img)
            g.CopyFromScreen(Me.Left, Me.Top, 0, 0, Img.Size)


This post has been edited by lar3ry: 05 January 2013 - 10:24 PM

Was This Post Helpful? 0
  • +
  • -

#3 xxrhy  Icon User is offline

  • D.I.C Head

Reputation: -1
  • View blog
  • Posts: 51
  • Joined: 08-April 12

Re: screenshots of entire form and save to access db.

Posted 05 January 2013 - 11:40 PM

thanks lar3ry. now i only getting my form not the whole desktop. thanks for the help. :bigsmile:
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1