Jump to content

Recommended Posts

Posted

is it possible to make a window or desktop zoom out tool like the magnifier tool in windows 7

zoom out to 25% of the original size

Posted (edited)

you mean zoom in, right?

example of taking screenshot, stretching it (zoom in)...if you really do want zoom out modify the $iZoomRatio to a decimal...like .25

note: I did not add in all the #includes, you will have to do that

AutoItSetOption ( "MouseCoordMode",1 )
$gsFILE_Background = "c:\screenshot.bmp"
$iWidth = 300
$iHeight = 300
$iZoomRatio = .75
Local $pos = MouseGetPos()
_ScreenCapture_Capture($gsFILE_Background, $pos[0]-$iWidth/$iZoomRatio, $pos[1]-$iHeight/$iZoomRatio, $pos[0]+$iWidth/$iZoomRatio, $pos[1]+$iHeight/$iZoomRatio)
GUICreate("ZoomIn", $iWidth, $iHeight) ; will create a dialog box that when displayed is centered
$hwndBackground = GUICtrlCreatePic($gsFILE_Background, 0, 0, $iWidth, $iHeight)
GUISetState(@SW_SHOW) ; will display an empty dialog box
; Run the GUI until the dialog is closed
$iPriorX = $pos[0]
$iPriorY = $pos[1]
While 1
 $msg = GUIGetMsg()
 If $msg = $GUI_EVENT_CLOSE Then ExitLoop
 Local $pos = MouseGetPos()
 If $pos[0]<>$iPriorX Or $iPriorY<>$pos[1] Then
  _ScreenCapture_Capture($gsFILE_Background, $pos[0]-$iWidth/$iZoomRatio, $pos[1]-$iHeight/$iZoomRatio, $pos[0]+$iWidth/$iZoomRatio, $pos[1]+$iHeight/$iZoomRatio)
  ;~  GUICtrlDelete($hwndBackground)
  ;~  $hwndBackground = GUICtrlCreatePic($gsFILE_Background, 0, 0, $iWidth, $iHeight)
  GUICtrlSetImage ( $hwndBackground, $gsFILE_Background )
  $iPriorX = $pos[0]
  $iPriorY = $pos[1]
 EndIf
WEnd
GUIDelete()
Edited by jdelaney
IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
  • Moderators
Posted

vin1,

I wrote this a while ago - it might give you some ideas: ;)

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <WinAPI.au3>
#include <Misc.au3>

Opt("GUICloseOnESC", 0)

HotKeySet("{ESC}", "On_Exit")

Global $hMag_GUI, $hMagDC, $hDeskDC, $hPen, $oObj, $aMouse_Pos[2], $iLast_Mouse_X = 0, $iLast_Mouse_Y = 0

; Create GUI
$hMag_Win = GUICreate("MAG", 100, 100, 0, 0, $WS_POPUP)
GUISetState(@SW_SHOW, $hMag_Win)
$hMag_GUI = WinGetHandle("MAG")
; Get device context for Mag GUI
$hMagDC = _WinAPI_GetDC($hMag_GUI)
If @error Then Exit
; Get device context for desktop
$hDeskDC = _WinAPI_GetDC(0)
If @error Then
    _WinAPI_ReleaseDC($hMag_GUI, $hMagDC)
    Exit
EndIf
; Create pen
$hPen = _WinAPI_CreatePen($PS_SOLID, 5, 0x7E7E7E)
$oObj = _WinAPI_SelectObject($hMagDC, $hPen)


While 1
    ; Check if cursor has moved
    $aMouse_Pos = MouseGetPos()
    If $aMouse_Pos[0] <> $iLast_Mouse_X Or $aMouse_Pos[1] <> $iLast_Mouse_Y Then
        ; Redraw Mag GUI
        Loupe($aMouse_Pos)
        ; Reset position
        $iLast_Mouse_X = $aMouse_Pos[0]
        $iLast_Mouse_Y = $aMouse_Pos[1]
    EndIf
WEnd

Func On_Exit()

    ; Clear up Mag GUI
    _WinAPI_SelectObject($hMagDC, $oObj)
    _WinAPI_DeleteObject($hPen)
    _WinAPI_ReleaseDC(0, $hDeskDC)
    _WinAPI_ReleaseDC($hMag_GUI, $hMagDC)
    GUIDelete($hMag_GUI)

    Exit

EndFunc   ;==>On_Exit

Func Loupe($aMouse_Pos)

    Local $iX, $iY

    ; Fill Mag GUI with 5x expanded contents of desktop area (10 pixels around mouse)
    DllCall("gdi32.dll", "int", "StretchBlt", _
        "int", $hMagDC,  "int", 0,                   "int", 0,                   "int", 100, "int", 100, _
        "int", $hDeskDC, "int", $aMouse_Pos[0] - 10, "int", $aMouse_Pos[1] - 10, "int",  20, "int",  20, _
        "long", $SRCCOPY)

    ; Keep Mag GUI on screen
    If $aMouse_Pos[0] < (@DesktopWidth - 120) Then
        $iX = $aMouse_Pos[0] + 20
    Else
        $iX = $aMouse_Pos[0] - 120
    EndIf
    If $aMouse_Pos[1] < (@DesktopHeight - 150) Then
        $iY = $aMouse_Pos[1] + 20
    Else
        $iY = $aMouse_Pos[1] - 120
    EndIf
    WinMove($hMag_GUI, "", $iX, $iY, 100, 100)

EndFunc   ;==>Loupe

Please ask if you have any questions. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

  Reveal hidden contents

 

Posted

Actually i wanted there to be a configuration option like the windows 7 magnifier options. zoom ability from 25% to 400%. windows 7 magnifier has that option of 25% zoom rate but somehow it doesnt work at less than 100% zoom even if you set it to 25%.

im interested in an option of 25% zoom on the entire screen (full screen) because it will zoom out if less than 100%.

post-77939-0-38284700-1366744778_thumb.p

post-77939-0-37975300-1366744786_thumb.p

Posted

Are you creating this yourself or do you want someone to create if for you? Why are you also reinventing the wheel?

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted

  On 4/24/2013 at 4:12 AM, 'vin1 said:

bump

Please wait at least 24 hours before bumping a thread. This is no 24 hours support forum!

My UDFs and Tutorials:

  Reveal hidden contents

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...