Code: Select all
OnExit handle_exit
Gui, +Owner +Resize +ToolWindow
WinGet, PrintSourceID, id
hdd_frame := DllCall( "GetDC", UInt, PrintSourceID )
hdb_frame := DllCall( "GetDC", UInt, active_id )
hbm_buffer := DllCall("gdi32.dll\CreateCompatibleBitmap", UInt,hdc_frame, Int,A_ScreenWidth, Int,A_ScreenHeight)
Gosub, Repaint
return
Repaint:
zoom := 2
Antialize := 1
delay := 8
start_x := 1280
start_y := 720
ww = 500
wh = 400
DllCall("gdi32.dll\StretchBlt", UInt,hdb_frame,Int,start_x - ww / 2 , Int,start_y - wh / 2
,Int,ww, Int,wh
,UInt,hdb_frame
,Int,start_x-(ww / 2 / zoom), Int,start_y - (wh/2/zoom)
,Int,ww / zoom, Int,wh / zoom
,UInt,0xCC0020) ; SRCCOPY
SetTimer, Repaint , %delay%
Return
GuiClose:
handle_exit:
DllCall("gdi32.dll\DeleteObject", UInt,hbm_buffer)
DllCall("gdi32.dll\DeleteDC", UInt,hdd_frame )
ExitApp
I want to magnify a central tangle area by 2, and display it in the same area of the screen. But when running this program, the magnify will go to a loop, the middle point will be magnified recursively