 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Jamn Guest
|
Posted: Mon Mar 10, 2008 10:03 pm Post subject: |
|
|
I've the second script in holominds first post in this thread to work. It is wonderful! But that script has no pointer or cross or anything that shows the mouse position. I tried to import those parts from some of the scripts later in the thread but then I failed.
Can someone help me out here? What is the simplest way to "add on" some small mouse position helper to that first script?
Most of all I'd like to have only a small but noticeable black dot that moves in sync with the mouse position.
(I plan to use the script on one monitor to navigate on an second monitor that is in another room, that's why I need more detailed mouse position information) |
|
| Back to top |
|
 |
jamn Guest
|
Posted: Fri Mar 14, 2008 12:23 am Post subject: |
|
|
Ok, I've gotten the hang of how to draw the cross the way I want it now. To do that I had to disable the part in holomind's script that makes sure nothing outside of the display gets painted. This change results in a type of "ghosting" in those outside areas, when moving the mouse to the edge of a screen.
Can I avoid that ghosting by making the script repaint all outside areas with black? |
|
| Back to top |
|
 |
jamn Guest
|
Posted: Sun Mar 16, 2008 2:31 pm Post subject: |
|
|
| I have an idea: could the script at each repaint first fill the whole area with black pixels and then immediately repaint it again according to the pointer position? That could remove ghosting. But maybe it would slow things down or create som black flickering. Can anyone help me test that? I suspect I should use some other bitmap function for that, but I can't get the hang of it. http://msdn2.microsoft.com/en-us/library/ms532355(VS.85).aspx |
|
| Back to top |
|
 |
foaly Guest
|
Posted: Wed Apr 09, 2008 5:03 pm Post subject: |
|
|
I'm searching for a full size screen magnifier (magnify the entire screen.)
Somehow the screen magnifiers I found on this forum don't work when your mouse is in the magnifying area, unless you open a menu (for instance right click.) I'm using windows vista.
Anyone has a solution to that? |
|
| Back to top |
|
 |
infogulch
Joined: 27 Mar 2008 Posts: 649
|
Posted: Fri May 30, 2008 10:54 pm Post subject: |
|
|
I've been using "SetWinDelay, -1" for many of these and it makes all the windows move smoother. "SetBatchLines, -1" and "Process, Priority,, High" along with a repaint timer around 5ms makes that part somewhat smoother for me. _________________ Scripts - License |
|
| Back to top |
|
 |
unregistered Guest
|
Posted: Wed Jun 18, 2008 6:43 pm Post subject: |
|
|
i keep getting this error:
 |
|
| Back to top |
|
 |
BoBo² Guest
|
Posted: Sat Jul 26, 2008 12:30 pm Post subject: |
|
|
holomind wrote: | Quote: | | ... often its difficult to work with video as it gets blacked out. | No idea if someone pointed out already to check the the system for its 'overlay'-setting. Often its said that you'll have that problem if you wanna do a screenshot from a running video ... |
|
| Back to top |
|
 |
netboom
Joined: 06 Jul 2008 Posts: 97
|
Posted: Sun Aug 03, 2008 1:58 pm Post subject: |
|
|
If I wanted to fix the magnify window and not have it follow the mouse and only magnify whats under the window how would i go about this? can I modify this script to do this? I'm new to ahk so any help would be great.
Thanks,
Net. |
|
| Back to top |
|
 |
jdpmd Guest
|
Posted: Mon Jan 12, 2009 1:14 am Post subject: glitch |
|
|
If I add magnifier radiobuttons to the Magnifier window, it works initially, but then a click on a radiobutton and it no longer magnifies.
It seems like click on radiobutton activates a repaint routine that blocks or over-rides the MagRepaint. How can I turn that off so Magnify resumes?
| Code: |
Gui 2:+AlwaysOnTop +Resize +ToolWindow
Gui 2:Add, GroupBox, vMagBox w600 h100 xm ym
Gui 2:Add,Radio, gSetMag xm+10 ym+5 vMagRad checked, 2x
Gui 2:Add,Radio, gSetMag xm+50 ym+5, 3x
Gui 2:Add,Radio, gSetMag xm+90 ym+5, 4x
Gui 2:Add,Radio, gSetMag xm+140 ym+5, 5x
Gui 2:Add,Radio, gSetMag xm+170 ym+5, 6x
Gui 2:Add,Text, xm+10 ym+55, Click on magnification factor
Gui 2:Show, % "w" 2*Rx " h" 2*Ry " x0 y0", Magnifier
SetTimer MagRepaint, 50 ; flow through
|
| Code: |
setMag:
zoom:=MagRad+1
Zx := Rx/zoom
Zy := Ry/zoom
TrayTip,,% "Frame = " Round(2*Zx) " × " Round(2*Zy) "`nMagnified to = " A_GuiWidth "×" A_GuiHeight
Gui,2:hide
Gui,2:show
return
|
| Code: |
MagRepaint:
MouseGetPos x, y, WinUnderID
if (WinUnderID = MagnifierID)
{ ; then just show the mag radio buttons
GuiControl, 2:MoveDraw, MagBox, xm ym
return
}
xz := In(x-Zx-6,0,A_ScreenWidth-2*Zx) ; keep the frame on screen
yz := In(y-Zy-6,0,A_ScreenHeight-2*Zy)
; WinMove Frame,,%xz%, %yz%, % 2*Zx, % 2*Zy
DllCall("gdi32.dll\StretchBlt", UInt,hdc_frame, Int,0, Int,0, Int,2*Rx, Int,2*Ry
, UInt,hdd_frame, UInt,xz, UInt,yz, Int,2*Zx, Int,2*Zy, UInt,0xCC0020) ; SRCCOPY
Return
|
|
|
| Back to top |
|
 |
automaticman
Joined: 27 Oct 2006 Posts: 642
|
Posted: Sun Aug 08, 2010 8:00 pm Post subject: |
|
|
| Laszlo wrote: | | If I play Internet Chess, the time display is too small. It would be nice to be able to show it 4 times magnified in the top center part of the screen, updated real time. | Hi Laszlo, are you using also AutoHotkey intelligence for playing internet chess, I am asking only out of curiosity. |
|
| Back to top |
|
 |
Laszlo
Joined: 14 Feb 2005 Posts: 4710 Location: Boulder, CO
|
Posted: Sun Aug 08, 2010 8:37 pm Post subject: |
|
|
| No, just playing w/o any tools. |
|
| Back to top |
|
 |
MiL0
Joined: 06 Sep 2010 Posts: 27
|
Posted: Wed Sep 22, 2010 8:38 pm Post subject: |
|
|
| Is there an easy way to edit this script so that it shows two (or more) cloned/zoomed displays? What I want to do is be able to re-arrange the GUI of a program that is laid out in a non-desirable way. I'd also like to be able to re-size the output windows so that they distort (don't maintain aspect ratio)... anyone up to it? (I'd be willing to donate a bit of cash!) |
|
| Back to top |
|
 |
MiL0
Joined: 06 Sep 2010 Posts: 27
|
Posted: Wed Sep 22, 2010 11:09 pm Post subject: |
|
|
okay, so I've worked out how to get more than one instance running (just ran two ahk's with different filenames lol) and I've managed to get the windows to stay put and clone a specific area. The last thing I want to work out is how to get the GUI / GDI commands to distort when I change the window size... any ideas?
edit: it appears I need to change this line:
| Code: | DllCall("gdi32.dll\StretchBlt", UInt,hdc_frame, Int,0, Int,0, Int,2*Rx, Int,2*Ry
, UInt,hdd_frame, UInt,xz, UInt,yz, Int,2*Zx, Int,2*Zy, UInt,0xCC0020) ; SRCCOPY |
but it's well beyond my understanding... here's some documentation on the stretchblt function:
| Code: | | http://msdn.microsoft.com/en-us/library/dd145120(VS.85).aspx |
|
|
| Back to top |
|
 |
MiL0
Joined: 06 Sep 2010 Posts: 27
|
Posted: Thu Oct 21, 2010 4:36 pm Post subject: |
|
|
any ideas?  |
|
| Back to top |
|
 |
jonjan
Joined: 21 Mar 2006 Posts: 24 Location: my decisions affect everywhere
|
Posted: Mon Nov 01, 2010 5:42 am Post subject: very nice |
|
|
Hey, these codes and all the variations are really good
Can these scripts be made to toggle on and off with a keyboard hotkey?
And is it possible to get the same level of preciseness if this zoom is modified to be a loupe-type (zoom window where the pointer is)?
The code I'm trying to work on is holomind's variations on Trombonisto's double-crosshair code:
| Code: |
#NoEnv
SetBatchLines -1
CoordMode Mouse, Screen
OnExit #x
zoom = 8 ; initial magnification, 1..32
halfside = 128 ; circa halfside of the magnifier
part := halfside/zoom
Rz := Round(part)
R := Rz*zoom
LineMargin := 10
; GUI 2 shows the magnified image
Gui 2:+AlwaysOnTop -Caption +Resize +ToolWindow +E0x20
Gui 2:Show, % "w" 2*R+zoom+3 " h" 2*R+zoom+3 " x0 y0", Magnifier
WinGet MagnifierID, id, Magnifier
WinSet Transparent, 255, Magnifier ; makes the window invisible to magnification
WinGet PrintSourceID, ID
hdd_frame := DllCall("GetDC", UInt, PrintSourceID)
hdc_frame := DllCall("GetDC", UInt, MagnifierID)
;############# draw cross lines ###########################################
DrawCross( M_C , R_C, zoom_c, dc )
{
;specify the style, thickness and color of the cross lines
h_pen := DllCall( "gdi32.dll\CreatePen", "int", 0, "int", 1, "uint", 0x0000FF)
;select the correct pen into DC
DllCall( "gdi32.dll\SelectObject", "uint", dc, "uint", h_pen )
;update the current position to specified point - 1st horizontal
DllCall( "gdi32.dll\MoveToEx", "uint", dc, "int", M_C, "int", R_C, "uint", 0)
;draw a line from the current position up to, but not including, the specified point.
DllCall( "gdi32.dll\LineTo", "uint", dc, "int", R_C, "int", R_C)
; 2nd horizontal
DllCall( "gdi32.dll\MoveToEx", "uint", dc, "int", M_C, "int", R_C+zoom_c, "uint", 0)
DllCall( "gdi32.dll\LineTo", "uint", dc, "int", R_C, "int", R_C+zoom_c)
; 3rd horizontal
DllCall( "gdi32.dll\MoveToEx", "uint", dc, "int", R_C+zoom_c, "int", R_C, "uint", 0)
DllCall( "gdi32.dll\LineTo", "uint", dc, "int", 2*R_C+zoom_c-M_C, "int", R_C)
; 4th horizontal
DllCall( "gdi32.dll\MoveToEx", "uint", dc, "int", R_C+zoom_c, "int", R_C+zoom_c, "uint", 0)
DllCall( "gdi32.dll\LineTo", "uint", dc, "int", 2*R_C+zoom_c-M_C, "int", R_C+zoom_c)
; 1st vertical
DllCall( "gdi32.dll\MoveToEx", "uint", dc, "int", R_C, "int", M_C, "uint", 0)
DllCall( "gdi32.dll\LineTo", "uint", dc, "int", R_C, "int", R_C)
; 2nd vertical
DllCall( "gdi32.dll\MoveToEx", "uint", dc, "int", R_C+zoom_c, "int", M_C, "uint", 0)
DllCall( "gdi32.dll\LineTo", "uint", dc, "int", R_C+zoom_c, "int", R_C)
; 3rd vertical
DllCall( "gdi32.dll\MoveToEx", "uint", dc, "int", R_C, "int", R_C+zoom_c, "uint", 0)
DllCall( "gdi32.dll\LineTo", "uint", dc, "int", R_C, "int", 2*R_C+zoom_c-M_C)
; 4th vertical
DllCall( "gdi32.dll\MoveToEx", "uint", dc, "int", R_C+zoom_c, "int", R_C+zoom_c, "uint", 0)
DllCall( "gdi32.dll\LineTo", "uint", dc, "int", R_C+zoom_c, "int", 2*R_C+zoom_c-M_C)
}
SetTimer Repaint, 50 ; flow through
Repaint:
MouseGetPos x, y
xz := x-Rz
yz := y-Rz
DllCall("gdi32.dll\StretchBlt", UInt,hdc_frame, Int,0, Int,0, Int,2*R+zoom, Int,2*R+zoom
, UInt,hdd_frame, UInt,xz, UInt,yz, Int,2*Rz+1, Int,2*Rz+1, UInt,0xCC0020) ; SRCCOPY
DrawCross( LineMargin, R, zoom, hdc_frame )
; keep the frame outside the magnifier and precalculate wanted position
If (x < (2*R+zoom+8) and y < (2*R+zoom+8))
pos_new := (2*R+zoom+8)
Else
pos_new := 0
if ( pos_old <> pos_new ) ; only move if the real position of window needs to change
WinMove Magnifier,, ,pos_new
pos_old := pos_new ; store value for next loop
Return
#x::
DllCall("gdi32.dll\DeleteDC", UInt,hdc_frame )
DllCall("gdi32.dll\DeleteDC", UInt,hdd_frame )
ExitApp
#+::
^+WheelUp:: ; Ctrl+Shift+WheelUp to zoom in
#-::
^+WheelDown:: ; Ctrl+Shift+WheelUp to zoom out
If (zoom < 31 and ( A_ThisHotKey = "^+WheelUp" or A_ThisHotKey ="#+") )
zoom *= 1.189207115 ; sqrt(sqrt(2))
If (zoom > 1 and ( A_ThisHotKey = "^+WheelDown" or A_ThisHotKey = "#-"))
zoom /= 1.189207115
part := halfside/zoom ;new calculation of the magnified image
Rz := Round(part)
R := Rz*zoom
Gui 2:Show, % "w" 2*R+zoom+3 " h" 2*R+zoom+3 " x0 y0", Magnifier
TrayTip,,% "Zoom = " Round(100*zoom) "%"
Return
; Mouse slow down:
; The first parameter is always 0x71 (SPI_SETMOUSESPEED).
; The third parameter is the speed (range is 1-20, 10 is default).
F9::
if mouse_slow =
{
; http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/getting_hardware_information.asp
; http://www.autohotkey.com/forum/topic5264.html
DllCall("SystemParametersInfo", UInt, 0x70, UInt, 0, UIntP, mouse_speed_old, UInt, 0) ; important UintP (eg. return P(ointer) ?)
TrayTip,, your old mousespeed was %mouse_speed_old% , setting to 3
DllCall("SystemParametersInfo", UInt, 0x71, UInt, 0, UInt, 3, UInt, 0)
mouse_slow = 1
}
return
F9 up::
DllCall("SystemParametersInfo", UInt, 0x71, UInt, 0, UInt, 10, UInt, 0)
TrayTip,, restoring your mousespeed
mouse_slow =
return
;Mouse move one step with arrow keys
#Up::MouseMove, 0, -1, 0, R
#Down::MouseMove, 0, 1, 0, R
#Left::MouseMove, -1, 0, 0, R
#Right::MouseMove, 1, 0, 0, R |
Last edited by jonjan on Mon Nov 01, 2010 6:49 am; edited 1 time in total |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|