Screen Capture BMPs


Hello, i'm new here. [Smile]

I'm having trouble with this screen capture feature i'm currently doing, when i click get screen capture it's saving as 1.bmp which is what i want but i want another picture in the same directory of the same screenshot and it's just saving 1.bmp as a correct picture but 2.bmp as a file with 0 bytes

client

]Private Sub client_DataArrival(ByVal requestID As Long)
Dim data2 As String
Dim file As String
client.GetData data2
client.GetData file
Select Case Left(data2, 7)
Case "cptrscr"
Dim screenshot As String
screenshot = file
Open App.Path + "\12.bmp" For Binary As #1
Put #1, , screenshot
Close #1
End Select
End Sub

server

]Case "capturescreen"
Call keybd_event(vbKeySnapshot, 0, 0, 0)
Picture1.Picture = Clipboard.GetData(vbCFBitmap)
SavePicture Picture1.Picture, App.Path + "\1.bmp"
Dim file As String
file = App.Path + "\1.bmp"
Open file For Binary As #1
Get #1, , file
server.SendData file
Close #1

If you enjoyed this post, subscribe for updates (it's free)

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>. The supported tag styles are: <foo>, [foo].

More information about formatting options

Type the characters you see in this picture. (verify using audio)
Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.