Sign in to follow this  
Followers 0
GodlessSinner

How to send screenshot without creating temporary file?

2 posts in this topic

#1 ·  Posted (edited)

Hi. I wrote this code:

FileDelete(@MyDocumentsDir & "\GDIPlus_Image.jpg")
Local $hBmp =   _ScreenCapture_Capture("", $xcord,  $ycord, $xcord + $width-1, $ycord + $height-1)
_ScreenCapture_SaveImage (@MyDocumentsDir & "\GDIPlus_Image.jpg", $hBmp)
$sFile = @MyDocumentsDir & "\GDIPlus_Image.jpg"
$tBuffer = DllStructCreate("byte["& FileGetSize($sFile) &"]")
$hFile = _WinAPI_CreateFile($sFile, 2, 2)
_WinAPI_SetFilePointer($hFile, 0)
_WinAPI_ReadFile($hFile, DllStructGetPtr($tBuffer), FileGetSize($sFile), $nBytes)
_WinAPI_CloseHandle($hFile)
TCPSend($ConnectedSocket, DllStructGetData($tBuffer, 1))

How to send image without creating temp-file?

Please, help.

Edited by GodlessSinner

_____________________________________________________________________________

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Is this impossible to get content of $hBmp and paste it into DllStruct?

Edited by GodlessSinner

_____________________________________________________________________________

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0