AutoHotkey Community

It is currently May 27th, 2012, 10:11 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 101 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7
Author Message
 Post subject: Re: figured it out
PostPosted: November 1st, 2010, 7:44 am 
Offline

Joined: March 21st, 2006, 11:11 pm
Posts: 24
Location: my decisions affect everywhere
newpie wrote:
I figured out how to do it. Thank you for everyone's time. I do have some other questions, but don't pertain to the magnifier script so I will post in other areas of the forum.


I sure wish you would have shared what you found! lol This is exactly half of what I am looking for :lol:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 9th, 2010, 4:23 pm 
Offline

Joined: November 28th, 2008, 9:09 am
Posts: 25
Is there a way to display the crosslines without having to redraw everything every 15 ms or whatever you use in settimer?
I am thinking of layers, like one layer get updated for the zoom and get updated every 15ms, and one layer does not get updated in order to reduce CPU usage.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 22nd, 2011, 12:07 am 
MiL0 wrote:
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


any ideas?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 28th, 2011, 8:54 pm 
Offline

Joined: September 6th, 2010, 9:04 pm
Posts: 27
also looking for a method to rotate the cloned windows by 90/180 degress... feasible?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 3rd, 2011, 2:34 pm 
Offline

Joined: July 10th, 2011, 5:03 am
Posts: 272
Is there a way to modify this so that the mouse cursor isn't hidden in the magnifier window??
I noticed a couple people have asked but couldn't find a response.

thanks, great script!!

Ben


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 3rd, 2011, 8:27 pm 
Offline

Joined: March 11th, 2006, 12:44 pm
Posts: 341
Location: Munich, Germany
yes4me wrote:
Is there a way to display the crosslines without having to redraw everything every 15 ms or whatever you use in settimer?
I am thinking of layers, like one layer get updated for the zoom and get updated every 15ms, and one layer does not get updated in order to reduce CPU usage.


you can just leave the area of the crosslines while copying with bitblt. so this way you would make 4 bitblts, which would be in sum nearly same time of processing cpu, and just "don't" copy the crosslines, and only update them when needed. as this is writiting to the hdc directly maybe you need to redraw the whole thing including the crosslines if you move the magnifier window itself.
you would copy like
1) left-up corner to -1,-1,
2) right-up corner to -1,1
3) right-down corner to 1,1
4) left-down corner to 1,-1
and basically leave the lines (-witdh,0) to (witdh,0) and (0,-height) to (0,height) effectively without repaint thus keeping the crosshair.

but the effect will be minimal as, painting the crosshair is very little cpu, even compared to a full repaint with bitblt, which also is very fast. (as 2d gipd operations are hardware accellerated). you can try to optimize, but my rough guess is, the overall performance benefit will be 1%, which means not noticable.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 3rd, 2011, 8:37 pm 
Offline

Joined: March 11th, 2006, 12:44 pm
Posts: 341
Location: Munich, Germany
MiL0 wrote:
also looking for a method to rotate the cloned windows by 90/180 degress... feasible?


it's possible with the image-transform functions. but it will be more complicated than just doing a bitblt. also it will involve the use of gdip_start etc. which is described in the gdip.ahk library.

http://msdn.microsoft.com/en-us/library ... 85%29.aspx

if you want to flip the whole screen/desktop by 90 or 180 degrees its better to do this in your display settings of the operating system as normally the graphics card support this natively.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 3rd, 2011, 8:52 pm 
Offline

Joined: March 11th, 2006, 12:44 pm
Posts: 341
Location: Munich, Germany
bmoore45 wrote:
Is there a way to modify this so that the mouse cursor isn't hidden in the magnifier window??
I noticed a couple people have asked but couldn't find a response.

thanks, great script!!

Ben


this will not be possible i guess, but you can clone the mouse, even magnified version of it. by drawing a "new" mouse on the corresponding position in the magnified window. one reason it is not shown in the magnified area is, that the mouse (and the cursor) are hardware accelleated and are drawn "on top" of the screen independent of other graphics, so the bitblt cannot "see" it and thus dont copy it. but actually some screenshot tools manage to copy the mouse, but maybe they even reinsert the mouse on top.
in windows you can even set a different mouse cursor, so for this purpose you could change it to crosshair which might be better for zoom operations . for example your mouse changes into a cursor if you type inside a text-field. (similar effect). i think there are some wmessage calls to change the cursor.

http://www.autohotkey.com/forum/topic62373.html
http://www.autohotkey.com/forum/viewtop ... sc&start=0

here is some ahk script to modify your mousepointer:
http://www.autohotkey.com/forum/topic2197.html

greetings....


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 29th, 2011, 8:10 pm 
Can someone make some relatively simple (but not for me) adjustments to this nice Magnifier script (made by ivanw), so that once the magnifier sticks to a position on the screen (it happens when the spacebar is pressed):

its window becomes inactive (that is, not affected by either spacebar or escape, or any other keys) and becomes active again only when clicked on by the mouse and

loses its connection with the mouse pointer, thus magnifying only the area over which its window is positioned.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: September 29th, 2011, 10:23 pm 
This script
Code:
; Autohotkey script "Screen Magnifier"
;=================================================================================
#SingleInstance ignore
Process, Priority, , High
OnExit handle_exit
hotkey, Space,  toggle_follow
hotkey, Escape, GuiClose
hotkey, F18,    GuiClose
; Init variables
  follow    := 1
  ZOOMFX    := 1.189207115
  zoom      := 2
  antialias := 1
  delay     := 10


  whMax     :=
  wh        := 10
  whMin     := 10

  wwMax     :=
  ww        := 100
  wwMin     := 20


  mx        := 0
  my        := 0
  mxp       := mx
  myp       := my
  wwD       := 0
  whD       := 0


; Init zoom window

  MouseGetPos, mx, my

  Gui, +AlwaysOnTop  +Owner -Resize -ToolWindow +E0x00000020
  Gui, Show, NoActivate W%ww% H%wh% X-1000 Y-1000, MagWindow ; start offscreen

  WinSet, Transparent  , 254, MagWindow
  Gui, -Caption
  Gui, +Border

  WinGet, PrintSourceID, id
  hdd_frame := DllCall("GetDC", UInt, PrintSourceID)

  WinGet, PrintScreenID,  id, MagWindow
  hdc_frame := DllCall("GetDC", UInt, PrintScreenID)
  if(antialias != 0)
      DllCall("gdi32.dll\SetStretchBltMode", "uint", hdc_frame, "int", 4*antialias)


Gosub, Repaint
return
;=================================================================================
; Input events

WheelUp::       ; zoom in
  if zoom < 4
      zoom *= %ZOOMFX%
return

WheelDown::     ; zoom out
  if zoom > %ZOOMFX%
      zoom /= %ZOOMFX%
return


+WheelDown::    ; larger
  wwD =  32
  whD =  32
  Gosub, Repaint
return

+WheelUp::      ; smaller
  wwD = -32
  whD = -32
  Gosub, Repaint
return

;=================================================================================
; toggle_follow
toggle_follow:
    follow := 1 - follow
return

; Repaint
Repaint:
    CoordMode,   Mouse, Screen
    MouseGetPos, mx, my
    WinGetPos,   wx, wy, ww, wh, MagWindow

    if(wwD != 0)
    {
       ww  += wwD
       wh  += whD
       wwD = 0
       whD = 0
    }

    if(mx != mxp) OR (my !- myp)
    {
        DllCall( "gdi32.dll\StretchBlt"
                , UInt, hdc_frame
                , Int , 2                       ; nXOriginDest
                , Int , 2                       ; nYOriginDest
                , Int , ww-6                    ; nWidthDest
                , Int , wh-6                    ; nHeightDest
                , UInt, hdd_frame               ; hdcSrc
                , Int , mx - (ww / 2 / zoom)    ; nXOriginSrc
                , Int , my - (wh / 2 / zoom)    ; nYOriginSrc
                , Int , ww / zoom               ; nWidthSrc
                , Int , wh / zoom               ; nHeightSrc
                , UInt, 0xCC0020)               ; dwRop (raster operation)

       if(follow == 1)
           WinMove, MagWindow, ,mx-ww/2, my-wh/2, %ww%, %wh%

        mxp = mx
        myp = my
    }

    SetTimer, Repaint , %delay%
return

; GuiClose handle_exit
GuiClose:
handle_exit:
   DllCall("gdi32.dll\DeleteDC"    , UInt,hdc_frame )
   DllCall("gdi32.dll\DeleteDC"    , UInt,hdd_frame )
Process, Priority, , Normal
ExitApp

;=================================================================================


Report this post
Top
  
Reply with quote  
 Post subject: Latest version
PostPosted: February 18th, 2012, 2:00 pm 
Offline

Joined: April 23rd, 2007, 12:41 pm
Posts: 15
Could someone confirm whether the version posted in the initial message is the latest version? If not, could I have a link to the latest version. Sometimes video is not smooth (every few seconds there's a very short pause before it jumps and catches up). Though maybe that's just a problem with my computer. Also, is there a way of hiding the mouse pointer?

_________________
http://www.timtranslates.com
For professional translations.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 101 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7

All times are UTC [ DST ]


Who is online

Users browsing this forum: specter333, XX0 and 25 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group