Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Copy a GDI+ Bitmap to Clipboard
#1
Macro capture_images
Trigger CS0     Help - how to add the trigger to the macro
Code:
Copy      Help
int h1 h2 h3 h4
CaptureImageOnScreen 6 262 1907 389 0 h1
key CT          ;; CTRL+TABULACION
0.1
CaptureImageOnScreen 6 262 1907 389 0 h2
key CT          ;; CTRL+TABULACION
0.1
CaptureImageOnScreen 6 262 1907 389 0 h3
key CT          ;; CTRL+TABULACION
0.1
CaptureImageOnScreen 6 262 1907 389 0 h4

;create empty destination image
GdipBitmap b.CreateEmpty(1907 1556)
GdipGraphics g.FromImage(b)
GdipBitmap im1.FromHBITMAP(h1)
GdipBitmap im2.FromHBITMAP(h2)
GdipBitmap im3.FromHBITMAP(h3)
GdipBitmap im4.FromHBITMAP(h4)

;draw images
,GDIP.GdipDrawImageI(g im1 0 0)
,GDIP.GdipDrawImageI(g im2 0 389)
,GDIP.GdipDrawImageI(g im3 0 389*2)
,GDIP.GdipDrawImageI(g im4 0 389*3)
,
b.Save("$Desktop$\test.jpg")

1) Is the best way to do this?
2)How can I save b in clipboard?
#2
1. Probably.
2.
Macro Macro471
Code:
Copy      Help
if(OpenClipboard(_hwndqm)) EmptyClipboard; SetClipboardData(CF_BITMAP b.GetHBITMAP(0 1)); CloseClipboard

If GetHBITMAP unknown, import from Collected QM apps, functions, samples. Probably added later, not in the first version.
#3
Thanks.
In my version, the function GetHBITMAP only supported a parameter...


Forum Jump:


Users browsing this thread: 1 Guest(s)