Hello
I want to capture the screen, then resize the image and then put it into a string (because i must send the picture through winsock to another pc)
I can capture the screen.
But by resizing and putting it into a string i'm having troubles.
I've got already a little bit code but the function StretchBlt won't put data into the variable "HdcOut".
thanks!!Code:'//api Declare Function GetDesktopWindow Lib "user32" () As Long Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long Public Declare Function StretchBlt Lib "gdi32" (ByVal hdc 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 nSrcWidth As Long, ByVal nSrcHeight As Long, ByVal dwRop As Long) As Long '//code Public Sub GetDesktop() Dim dhandle As Long Dim HdcOut As Long dhandle = GetDesktopWindow Dim ddc As Long ddc = GetDC(dhandle) StretchBlt HdcOut, 0, 0, 640, 480, ddc, 0, 0, Screen.Width / Screen.TwipsPerPixelX, Screen.Height / Screen.TwipsPerPixelY, vbSrcCopy End Sub




Reply With Quote