Posts: 1,769
Threads: 410
Joined: Feb 2003
Since I cannot have a transparent background on an OnScreenDisplay, I'd like to be able to grab a section of the desktop image (as it shows rather than out of the file itself) and put that into an OSD background so that it 'looks' like its transparent?
Posts: 12,073
Threads: 140
Joined: Dec 2002
I can try to do it on Vista but don't know how on XP.
Posts: 1,769
Threads: 410
Joined: Feb 2003
how about doing it old school on XP with a W+d and grabbing a block of pixels from x y to x2 y2 and saving that to a jpg?
Posts: 12,073
Threads: 140
Joined: Dec 2002
toolbar would not be updated when background changes, for example when you move toolbar
Posts: 1,769
Threads: 410
Joined: Feb 2003
that's ok...I would call the process each time anyway if necessary anyway.
Posts: 12,073
Threads: 140
Joined: Dec 2002
Toolbar
;/hook tb_hook_chameleon
test :out "test"
Function
tb_hook_chameleon
;/
function# hWnd message wParam lParam
sel message
,case WM_INITDIALOG
,__MemBmp* mb._new
,SetProp hWnd "tb_hook_chameleon_mb" mb
,RECT r
,GetClientRect hWnd &r
,POINT p; ClientToScreen hWnd &p
,mb.Create(r.right r.bottom 1 p.x p.y)
,
,case WM_DESTROY
,mb=+GetProp(hWnd "tb_hook_chameleon_mb")
,mb._delete
,RemoveProp hWnd "tb_hook_chameleon_mb"
,
,case WM_ERASEBKGND
,mb=+GetProp(hWnd "tb_hook_chameleon_mb")
,GetClientRect hWnd &r
,BitBlt wParam 0 0 r.right r.bottom mb.dc 0 0 SRCCOPY
,ret 1
Posts: 1,769
Threads: 410
Joined: Feb 2003
:lol:
wow that is amazing! and it works a lot faster than i thought it would too!
I was looking over the code but can't seem to make sense of it enough to do that for an OSD too. How can I do that?
Posts: 12,073
Threads: 140
Joined: Dec 2002
this is without changing system functions
Macro
str s="text wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww"
;at first show transparent OSD
OnScreenDisplay s 0 0 0 0 0 0 0 "osd_chameleon"
;get its coordinates
int hWnd=win("osd_chameleon" "QM_OSD_Class")
RECT r; GetClientRect hWnd &r
POINT p; ClientToScreen hWnd &p
;capture screen and save bitmap
__MemBmp mb
mb.Create(r.right r.bottom 1 p.x p.y)
SaveBitmap mb.bm "$temp$\osd_chameleon.bmp"
;close
spe; hid hWnd; clo hWnd
;then show another OSD with that bitmap
OnScreenDisplay 0 0 p.x-1 p.y-1 0 0 0 1|128|16 0 0 0 "$temp$\osd_chameleon.bmp"
Posts: 1,769
Threads: 410
Joined: Feb 2003
oh, now this is just fantastic!
thanks.