_ScreenCapture_CaptureWnd ( $g_SnapShotDirectory & "\" & $g_sSnapShotName & "_Edited.jpg", $g_SnapShotWindow, 0 , 0, -1, -1, False ) ; Save a copy to disk
_GDIPlus_Startup()
Local $hImg = _GDIPlus_ImageLoadFromFile($g_SnapShotDirectory & "\" & $g_sSnapShotName & "_Edited.jpg")
Local $hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImg)
_GDIPlus_ImageDispose($hImg)
_GDIPlus_Shutdown()
_ClipBoard_SetData($hBitmap)
Repro Steps:
- Capture screenshot of window, save to disk
- Load image from disk
- Convert it into a HBITMAP
- Place the image on the clipboard
Results:
- Nothing getting on the clipboard (pasting into mspaint not working)
Expected:
- Image is placed on clipboard so I can paste it into other apps.
I'm missing something because many other people have done this and this code is pretty much copy/paste out of other forum posts. What am I doing wrong? I tried adding $CF_BITMAP for the iFormat param but nothing changed.