Posts: 1,058
Threads: 367
Joined: Oct 2007
In relation to topic
Prepare "off-screen" bitmap information
I wonder whether it is possible to save the result of an
Quote:OnScreenDisplay
command, in clipboard as a bitmap file ?
Many thanks for any advice
Posts: 12,073
Threads: 140
Joined: Dec 2002
Macro
Macro2769
OnScreenDisplay "Text" 0 0 0 "" 0 0 1 "get_bitmap"
int w=wait(0 WV win("get_bitmap" "QM_OSD_Class"))
RECT r; GetClientRect w &r
__Hdc dc.Init(w)
__MemBmp m.Create(r.right r.bottom dc)
dc.Release
OsdHide "get_bitmap"
if(!OpenClipboard(_hwndqm)) end "failed"
EmptyClipboard
if(SetClipboardData(CF_BITMAP m.bm)) m.bm=0
CloseClipboard
act "Paint"
key Cv
Posts: 1,058
Threads: 367
Joined: Oct 2007
Thank you for this very smart solution. Let me further ask a couple of questions :
(a) Why does the thin border of OnScreenDisplay is lost when saving / pasting ?
(b) Referring to the OnScreenDisplay command itself : Is it possible to increase the pixel-size and/or the color of the border?
Posts: 12,073
Threads: 140
Joined: Dec 2002
It copied only the client area.
This code copies whole window view from screen.
Macro
Macro2771
OnScreenDisplay "Text" 0 0 0 "" 0 0 1 "get_bitmap"
int w=wait(0 WV win("get_bitmap" "QM_OSD_Class"))
0.1
RECT r; GetWindowRect w &r
CaptureImageOnScreen r.left r.top r.right-r.left r.bottom-r.top
OsdHide "get_bitmap"
act "Paint"
key Cv
(b) OnScreenDisplay itself - no.