How I load the image other types?
Posted: Sun Nov 25, 2007 7:14 pm
How I load the image?
I have a code of the creation screenshot (VB.NET):
As possible load in GflAx got hBMP, if oBackground has a type System.Draving.Bitmap, but it is need type stdole.IPicture? What convert System.Draving.Bitmap in stdole.IPicture?
Please, don't advise me to use other way of the creation a screenshot - I necessary to do screenshot without use Clipboard.
Best regards, user GflAx
I have found the decision! Thnx to all...
I have a code of the creation screenshot (VB.NET):
Code: Select all
Protected Sub CaptureScreen()
Dim hSDC, hMDC As Integer
Dim hBMP, hBMPOld As Integer
Dim rC As Integer
hSDC = CreateDC("DISPLAY", "", "", "")
hMDC = CreateCompatibleDC(hSDC)
FW = GetDeviceCaps(hSDC, 8)
FH = GetDeviceCaps(hSDC, 10)
hBMP = CreateCompatibleBitmap(hSDC, FW, FH)
hBMPOld = SelectObject(hMDC, hBMP)
rC = BitBlt(hMDC, 0, 0, FW, FH, hSDC, 0, 0, 13369376)
hBMP = SelectObject(hMDC, hBMPOld)
rC = DeleteDC(hSDC)
rC = DeleteDC(hMDC)
oBackground = Image.FromHbitmap(New IntPtr(hBMP))
DeleteObject(hBMP)
End Sub
Please, don't advise me to use other way of the creation a screenshot - I necessary to do screenshot without use Clipboard.
Best regards, user GflAx
I have found the decision! Thnx to all...