Results 1 to 3 of 3

Thread: Screenshot problems . .. .

  1. #1

    Thread Starter
    Addicted Member NewGen's Avatar
    Join Date
    Nov 2002
    Location
    olathe, ks
    Posts
    152

    Screenshot problems . .. .

    I have a huge amount of code and i found the line that is wrong. I am taking a screenshot, saving it to a temporary file (*.bmp) and opening it up for transfer via winsock. Could someone read over my code and tell me what is wrong? By the way my error is:

    Variable uses an automtion type not supported in VB.

    The error line is changed to a comment!
    VB Code:
    1. Private Sub Winsock3_DataArrival(ByVal bytesTotal As Long)
    2. Dim PicDat
    3. Winsock3.GetData PicDat, vbString, bytesTotal
    4.  
    5. If PicDat = "PICPLZ" Then
    6.      Dim hwnd&, hdc&
    7.      hwnd& = GetDesktopWindow()
    8.      hdc& = GetDC(hwnd&)
    9.      BitBlt Form1.hdc, 0, 0, Screen.Width / 15, Screen.Height / 15, hdc&, 0, 0, SRCCOPY
    10.      DoEvents
    11.      
    12.      SavePicture Form1.Image, App.Path + "\Temp" + ".BMP"
    13.  
    14.      DoEvents
    15.      Open App.Path & "\Temp.BMP" For Binary As #1
    16.      
    17.      PicCont = String(FileLen(App.Path & "\Temp.BMP"), " ")
    18.      'Get #1, , PicCont
    19.      DoEvents
    20.      Close #1
    21.      Winsock3.SendData PicCont
    22.      DoEvents
    23. End If
    24.  
    25. End Sub

    Kinda lengthy and messy.

  2. #2

    Thread Starter
    Addicted Member NewGen's Avatar
    Join Date
    Nov 2002
    Location
    olathe, ks
    Posts
    152

    Help!

    I really need help on this because this has to be done in two days and i have to add the file transfer features so if i could get help asap it would be great.

  3. #3
    Fanatic Member jian2587's Avatar
    Join Date
    Aug 2000
    Location
    I bet u need a fusion powered shuttle to reach my place...
    Posts
    963
    Have u declare PicCont as a string?
    If the prob still persists, try this code:
    VB Code:
    1. PicCont = Input$(FileLen(FilePath),#1)
    2. 'instead of:
    3. Get #1,,PicCont
    ASM,C,C++,BASIC,VB,JAVA,VBS,HTML,ASP,PHP,mySQL,VB.NET,MATLAB
    Programming is fun, but only if you're not on a tight deadline
    So I consider all those working engineers sad people

    VB FTP class
    3 page PHP crash course
    Crash Course on DX9 Managed with VB.NET covering basics till terrain creation

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