err what do you mean turn it to a bitmap and not save it on the hard drive, by taking the screenshot it is already a bitmap in memory, do you mean get at its bitmap handle? if so you want to use the selectobject, deleteobject and createcompatiblebitmap apis
hope that's what you wanted.Code:Private Declare Function SelectObject Lib "gdi32" (ByVal hDC As Long, ByVal hObject As Long) As Long Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long Private Declare Function CreateCompatibleBitmap Lib "gdi32" (ByVal hDC As Long, ByVal nWidth As Long, ByVal nHeight As Long) As Long Public Function BitmapFromDC(ByVal hDC As Long) As Long Dim retval As Long retval = SelectObject(hDC, CreateCompatibleBitmap(hDC, 1, 1)) DeleteObject SelectObject(hDC, retval) BitmapFromDC = retval End Function




Reply With Quote