Results 1 to 3 of 3

Thread: Graphics Help

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 1999
    Location
    metairie, la usa
    Posts
    40

    Post

    Hi,
    I'm developing a program for work that need to capture the current screen and save it as some sort of graphic file (like a screen capture). I think there should be some kind of api routine that will do the trick, but I'm not sure. Please Help
    Thanks
    Richard Lange
    [email protected]



  2. #2
    Guest

    Post

    Hi, I took this code from one example from this site but add the save feature.

    Code:
    Private Declare Function GetDesktopWindow Lib "user32" () As Long
    Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
    Private Declare Function BitBlt Lib "gdi32" _
                                        (ByVal hDestDC As Long, _
                                         ByVal x As Long, _
                                         ByVal y As Long, _
                                         ByVal nWidth As Long, _
                                         ByVal nHeight As Long, _
                                         ByVal hSrcDC As Long, _
                                         ByVal xSrc As Long, _
                                         ByVal ySrc As Long, _
                                         ByVal dwRop As Long) As Long
    
    Private Sub Form_Load()
    Dim A As Long
    Dim s As Long
    Form1.AutoRedraw = True
    Form1.ScaleMode = 1
    A = GetDesktopWindow()
    s = GetDC(A)
    BitBlt Me.hDC, 0, 0, Screen.Width, Screen.Height, s, 0, 0, vbSrcCopy
    SavePicture Me.Image, "image.bmp"
    
    End Sub
    Kayan.

  3. #3
    New Member
    Join Date
    Mar 2000
    Location
    denmark
    Posts
    2

    Post

    Hi

    what if a want to save and send a form as a bmp file to a mail receptionist. I can start up my outlook express and want to send a form with e-mail.


    Hi, I took this code from one example from this site but add the save feature.

    Code:
    Private Declare Function GetDesktopWindow Lib "user32" () As Long
    Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
    Private Declare Function BitBlt Lib "gdi32" _
                                        (ByVal hDestDC As Long, _
                                         ByVal x As Long, _
                                         ByVal y As Long, _
                                         ByVal nWidth As Long, _
                                         ByVal nHeight As Long, _
                                         ByVal hSrcDC As Long, _
                                         ByVal xSrc As Long, _
                                         ByVal ySrc As Long, _
                                         ByVal dwRop As Long) As Long
    
    Private Sub Form_Load()
    Dim A As Long
    Dim s As Long
    Form1.AutoRedraw = True
    Form1.ScaleMode = 1
    A = GetDesktopWindow()
    s = GetDC(A)
    BitBlt Me.hDC, 0, 0, Screen.Width, Screen.Height, s, 0, 0, vbSrcCopy
    SavePicture Me.Image, "image.bmp"
    
    End Sub
    Kayan.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width