04-11-2013, 04:37 PM
Macro Macro15
Damned was close....
#compile "__Gdip"
GdipBitmap-- t_im t_out
OpenClipboard(0)
t_im.FromHBITMAP(GetClipboardData(CF_BITMAP))
CloseClipboard
if(!t_im) out "failed to get bitmap from clipboard"
;note: don't need to delete bitmap when from clipboard
__MemBmp-- mb.Create(300 300)
PAINTSTRUCT ps
BeginPaint 0 &ps
BITMAP b; GetObjectW mb.bm sizeof(BITMAP) &b
BitBlt mb.dc 0 0 b.bmWidth b.bmHeight ps.hDC 0 0 SRCCOPY
EndPaint 0 &ps
t_out.GetHBITMAP(mb.bm)
t_out.Save("q:\g.png")
Damned was close....