Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
OnScreenDisplay result saved to clipboard
#1
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
#2
Macro Macro2769
Code:
Copy      Help
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
#3
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?
#4
It copied only the client area.

This code copies whole window view from screen.

Macro Macro2771
Code:
Copy      Help
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.


Forum Jump:


Users browsing this thread: 1 Guest(s)