Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Magnifier programming?
#1
Hello,
There is some function in qm, when capturing images. Can I make some magnifier like this, to enlarge specific program texts or windows?
at the end that should be able, to have some different triggers for different windows and different positions and sizes of the magnifier, and perhaps sometimes follow the mouse cursor, or jump, like if I capture in qm. Possibly it should show mouse or cursor as well.
But first: is it principally possible to program something like the capture magnifier, then I can do some experiments?
thanks hasi
#2
Function dialog_magnifier
Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

if(!ShowDialog("dialog_magnifier" &dialog_magnifier)) ret

;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 223 135 "Dialog"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2020103 "" "" ""


ret
;messages
sel message
,case WM_INITDIALOG
,SetTimer hDlg 1 50 0
,
,case WM_TIMER
,if(wParam=1)
,,POINT p; xm p ;;get mouse pos
,,int dcs(GetDC(0)) dcd(GetDC(hDlg)) ;;get screen dc and dialog dc
,,StretchBlt dcd 0 0 128 128 dcs p.x p.y 16 16 SRCCOPY ;;copy from screen to dialog, and magnify 8 times, from 16 to 128
,,ReleaseDC 0 dcd; ReleaseDC 0 dcs
,
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1
#3
wow, that allows me to watch for something on the first screen and to display the result zoomed on the second one.

can you teach us how to draw an rectangle for selecting an area of interest on screen ?

like click on zoom button,
make rectangle selection
and return x y cx cy
pi
#4
To draw and erase focus rectangle can be used

GetDC(0)
DrawFocusRect
ReleaseDC

But not sure it will work well when drawing on windows of other apps. Alternatively can be used transparent dialog or toolbar that does not have any border and caption styles except WS_BORDER (1 pixel black border).


Forum Jump:


Users browsing this thread: 1 Guest(s)