Results 1 to 9 of 9

Thread: client screen cature to server app

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2002
    Location
    calgary, ab
    Posts
    2

    Talking client screen cature to server app

    I have seen a few postings for a similar questions, but none really answered my questions.

    I am attempting to create a client/server application that passes a screen shot from a client computer to a server computer. I am using a module and form code that I have tested on a single computer and it works great. Now I have to pass the image
    somehow from the client to the server. I am using MSWinsock between the computers (but am open to any suggestions as to other ways to pass the image). Attached is the Module I use for the screen capture.


    This is the code in the form:
    Set imgList1.Picture = CaptureWindow(0, 0, 0, Screen.Width / Screen.TwipsPerPixelX, Screen.Height / Screen.TwipsPerPixelY)
    Attached Files Attached Files
    What's new will not always be...
    What's you will...

  2. #2
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    uhmm what are you asking for?
    Sanity is a full time job

    Puh das war harter Stoff!

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2002
    Location
    calgary, ab
    Posts
    2

    screen capture over network

    I am attempting to pass a screen capture from a client machine to a server machine via Winsock. I would rather not save the image to the clipboard and then transfer the image, this take up too many resources.

    If you have any suggestions on how to do this I would greatly appreciate the help.
    What's new will not always be...
    What's you will...

  4. #4
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    What you're going to want to do is save this picture as a bitmap using the SavePicture technique. Then you can open it in Binary mode, read the bytes, and send them through Winsock. However these can be quite large so JPEG compression is advisable. Then, at the other side, save the incoming bytes to a file, and then LoadPicture it into another Picturebox, or whatever you'd like to do.
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  5. #5
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    go for sastraxis way! there is some intel dll to compress jpegs, which will be really useful for you. If you can't use any quality get at least some information on how to save with RLE compression.
    And remember data does not arrive in one big piece over slower connections unlike if you have your server and client running on one machine.
    Sanity is a full time job

    Puh das war harter Stoff!

  6. #6
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    Try this
    VB Code:
    1. Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, _
    2. ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
    3.  
    4. Private Const VK_SNAPSHOT = &H2C
    5.  
    6. Private Function SaveScreen(ByVal theFile As String) As Boolean
    7. On Error Resume Next
    8.  
    9. 'To get the Entire Screen
    10. Call keybd_event(vbKeySnapshot, 1, 0, 0)
    11.  
    12. 'To get the Active Window
    13. 'Call keybd_event(vbKeySnapshot, 0, 0, 0)
    14.  
    15. SavePicture Clipboard.GetData(vbCFBitmap), theFile
    16.  
    17. SaveScreen = True
    18. Exit Function
    19. End Function
    20. 'Where M: is a drive on a network server
    21. Call SaveScreen("M:\MyFolder\DesktopShots\shot1.bmp")

  7. #7
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    Yeah, thats the code
    You can find more about Intel''s JPEG compression on http://www.vbaccelerator.com/.
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  8. #8
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    this code requires a network drive to be set up though.
    Sanity is a full time job

    Puh das war harter Stoff!

  9. #9
    Lively Member
    Join Date
    Jul 2000
    Posts
    82
    http://vbaccelerator.com/codelib/gfx/vbjpeg.htm - the correct address to save jpg in vb... just to simplify things...

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