<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Открыть изображение, увеличить и получить координаты под курсором]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=13355</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=13355&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Открыть изображение, увеличить и получить координаты под курсором».]]></description>
		<lastBuildDate>Wed, 10 Jan 2018 20:32:57 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Открыть изображение, увеличить и получить координаты под курсором]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=122979#p122979</link>
			<description><![CDATA[<p>Тогда в личку пишите.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Wed, 10 Jan 2018 20:32:57 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=122979#p122979</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Открыть изображение, увеличить и получить координаты под курсором]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=122978#p122978</link>
			<description><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>Возможно, но пока времени нет.</p></blockquote></div><p>Желание компенсировать время было еще до этого сообщения <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></description>
			<author><![CDATA[null@example.com (ser-bilichenko)]]></author>
			<pubDate>Wed, 10 Jan 2018 20:23:51 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=122978#p122978</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Открыть изображение, увеличить и получить координаты под курсором]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=122977#p122977</link>
			<description><![CDATA[<p>Возможно, но пока времени нет. <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Wed, 10 Jan 2018 20:20:57 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=122977#p122977</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Открыть изображение, увеличить и получить координаты под курсором]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=122975#p122975</link>
			<description><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p> пробуйте</p></blockquote></div><p>Спасибо преогромнейшее!!! Отлично увеличивает. <br />Возможно я хочу очень много и сразу, но хотелось бы узнать возможно ли разворачивать (или сразу сделать по умолчанию) окно на весь экран? Возможно ли сделать регулировку или сделать чуть быстрее увеличение/уменьшение? И последнее, это извлечение координаты при клике на картинке(именно координат картинки, а не экрана).<br />Еще раз благодарю.</p>]]></description>
			<author><![CDATA[null@example.com (ser-bilichenko)]]></author>
			<pubDate>Wed, 10 Jan 2018 20:08:15 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=122975#p122975</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Открыть изображение, увеличить и получить координаты под курсором]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=122908#p122908</link>
			<description><![CDATA[<p><strong>ser-bilichenko</strong>, пробуйте:<br /></p><div class="codebox"><pre><code>SetWorkingDir, %A_ScriptDir%
SetBatchLines, -1
if !FileExist(&quot;AHK.png&quot;)
   URLDownloadToFile, https://autohotkey.com/assets/images/ahk-logo-no-text241x78-180.png, AHK.png

imagePath := &quot;AHK.png&quot;

Gui, +hwndhGui
Gui, Margin, 20, 20
Gui, Add, Pic, w600 h250 hwndhPic border
oPic := new DrawPicture(imagePath, hPic)
Gui, Show
Return

GuiClose:
   ExitApp

#If WinActive(&quot;ahk_id&quot; . hGui)
WheelUp:: oPic.ChangeSize(10)  ; +10%
WheelDown:: oPic.ChangeSize(-9.09)  ; -9.09%
#If

class DrawPicture
{
   __New(sFile, hPic)  {
      this.hPic := hPic
      this.GDI := new GDIp
      this.pBitmap := this.GDI.BitmapFromFile(sFile)
      WinGetPos,,, W, H, ahk_id %hPic%
      this.PicWidth := W, this.PicHeight := H
      
      this.hDC := DllCall(&quot;GetDC&quot;, Ptr, hPic, Ptr)
      this.oMDC := new this.CompatibleDC(this.hDC, this.PicWidth, this.PicHeight)
      this.mDC := this.oMDC.hCDC
      this.hCBM := DllCall(&quot;CreateCompatibleBitmap&quot;, Ptr, this.hDC, Int, this.PicWidth, Int, this.PicHeight, Ptr)
      this.oBM := DllCall(&quot;SelectObject&quot;, Ptr, this.mDC, Ptr, this.hCBM, Ptr)
      
      this.GDI.GetImageDimensions(this.pBitmap, width, height)
      this.BitmapSize := { W: width, H: height }
      this.CurrentSize := this.BitmapSize.Clone()
      this.CurrentSize.X := (this.PicWidth - this.CurrentSize.W)//2
      this.CurrentSize.Y := (this.PicHeight - this.CurrentSize.H)//2
      this.Draw()
      
      OnMessage( 0xF, ObjBindMethod(this, &quot;WM_PAINT&quot;) )
   }
   
   __Delete()  {
      this.oMDC := &quot;&quot;
      DllCall(&quot;DeleteDC&quot;, Ptr, this.hDC)
      this.GDI.DisposeImage(this.pBitmap)
      this.GDI := &quot;&quot;
   }
   
   ChangeSize(step)  {
      CoordMode, Mouse
      MouseGetPos, X, Y
      WinGetPos, X_Pic, Y_Pic,,, % &quot;ahk_id&quot; . this.hPic
      
      X_Mouse := X - X_Pic
      Y_Mouse := Y - Y_Pic
      
      dX := X_Mouse - this.CurrentSize.X
      dY := Y_Mouse - this.CurrentSize.Y
      
      this.CurrentSize.X -= dX/100 * step
      this.CurrentSize.Y -= dY/100 * step
      
      this.CurrentSize.W += this.CurrentSize.W/100 * step
      this.CurrentSize.H += this.CurrentSize.H/100 * step
      
      this.Draw()
   }
   
   Draw()  {
      oMDC := new this.CompatibleDC(this.hDC, this.PicWidth, this.PicHeight)
      hMDC := oMDC.hCDC
      G := this.GDI.GraphicsFromHDC(hMDC)
      this.GDI.SetSmoothingMode(G, 4)  ; AntiAlias = 4
      DllCall(&quot;Rectangle&quot;, Ptr, hMDC, Int, -1, Int, -1, Int, this.PicWidth + 2, Int, this.PicHeight + 2)
      this.GDI.DrawImage(G, this.pBitmap, this.CurrentSize.X, this.CurrentSize.Y
                                        , this.CurrentSize.W, this.CurrentSize.H
                                        , 0, 0, this.BitmapSize.W, this.BitmapSize.H)
      this.BitBlt(this.hDC, hMDC)
      this.BitBlt(this.mDC, hMDC)
      this.GDI.DeleteGraphics(G)
   }
   
   WM_PAINT(wp, lp, msg, hwnd)  {
      hParent := DllCall(&quot;GetParent&quot;, Ptr, this.hPic)
      if (hParent = hwnd)  {
         timer := ObjBindMethod(this, &quot;BitBlt&quot;, this.hDC, this.mDC)
         SetTimer, % timer, -10
      }
   }
   
   BitBlt(ddc, sdc)  {
      DllCall(&quot;BitBlt&quot;, Ptr, ddc, Int, 0, Int, 0, Int, this.PicWidth, Int, this.PicHeight
                      , Ptr, sdc, Int, 0, Int, 0, UInt, SRCCOPY := 0xCC0020)
   }
   
   class CompatibleDC
   {
      __New(hDC, w, h)  {
         this.hCDC := DllCall(&quot;CreateCompatibleDC&quot;, Ptr, hDC, Ptr)
         this.hCBM := DllCall(&quot;CreateCompatibleBitmap&quot;, Ptr, hDC, Int, w, Int, h, Ptr)
         this.oBM := DllCall(&quot;SelectObject&quot;, Ptr, this.hCDC, Ptr, this.hCBM, Ptr)
      }
      
      __Delete()  {
         DllCall(&quot;SelectObject&quot;, Ptr, this.hCDC, Ptr, this.oBM, Ptr)
         DllCall(&quot;DeleteDC&quot;, Ptr, this.hCDC)
         DllCall(&quot;DeleteObject&quot;, Ptr, this.hCBM)
      }
   }
}

class GDIp   {
   __New() {
      if !DllCall(&quot;GetModuleHandle&quot;, Str, &quot;gdiplus&quot;, Ptr)
         DllCall(&quot;LoadLibrary&quot;, Str, &quot;gdiplus&quot;)
      VarSetCapacity(si, A_PtrSize = 8 ? 24 : 16, 0), si := Chr(1)
      DllCall(&quot;gdiplus\GdiplusStartup&quot;, UPtrP, pToken, Ptr, &amp;si, Ptr, 0)
      this.token := pToken
   }
   
   __Delete()  {
      DllCall(&quot;gdiplus\GdiplusShutdown&quot;, Ptr, this.token)
      if hModule := DllCall(&quot;GetModuleHandle&quot;, Str, &quot;gdiplus&quot;, Ptr)
         DllCall(&quot;FreeLibrary&quot;, Ptr, hModule)
   }
   
   BitmapFromFile(sFile)  {
      DllCall(&quot;gdiplus\GdipCreateBitmapFromFile&quot;, WStr, sFile, PtrP, pBitmap)
      Return pBitmap
   }
   
   GraphicsFromHDC(hdc)  {
      DllCall(&quot;gdiplus\GdipCreateFromHDC&quot;, Ptr, hdc, PtrP, pGraphics)
      return pGraphics
   }
   
   SetSmoothingMode(pGraphics, SmoothingMode)  {
      return DllCall(&quot;gdiplus\GdipSetSmoothingMode&quot;, Ptr, pGraphics, Int, SmoothingMode)
   }
   
   DrawImage(pGraphics, pBitmap, dx, dy, dw, dh, sx, sy, sw, sh)  {
      DllCall(&quot;gdiplus\GdipDrawImageRectRect&quot;, Ptr, pGraphics, Ptr, pBitmap
                                             , Float, dx, Float, dy, Float, dw, Float, dh
                                             , Float, sx, Float, sy, Float, sw, Float, sh
                                             , Int, 2, Ptr, 0, Ptr, 0, Ptr, 0)
   }
   
   GetImageDimensions(pBitmap, ByRef Width, ByRef Height)  {
      DllCall(&quot;gdiplus\GdipGetImageWidth&quot;, Ptr, pBitmap, UIntP, Width)
      DllCall(&quot;gdiplus\GdipGetImageHeight&quot;, Ptr, pBitmap, UIntP, Height)
   }
   
   DisposeImage(pBitmap)  {
      return DllCall(&quot;gdiplus\GdipDisposeImage&quot;, Ptr, pBitmap)
   }
   
   DeleteGraphics(pGraphics)  {
      return DllCall(&quot;gdiplus\GdipDeleteGraphics&quot;, Ptr, pGraphics)
   }
}</code></pre></div><p>Сейчас картинка загружается из интернета. Вы можете удалить строчки<br /></p><div class="codebox"><pre><code>if !FileExist(&quot;AHK.png&quot;)
   URLDownloadToFile, https://autohotkey.com/assets/images/ahk-logo-no-text241x78-180.png, AHK.png</code></pre></div><p>и прописать в переменной <em>imagePath</em> путь к нужному изображению.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Tue, 09 Jan 2018 23:07:31 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=122908#p122908</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Открыть изображение, увеличить и получить координаты под курсором]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=122887#p122887</link>
			<description><![CDATA[<p>Вот есть тема ,незнаю подойдёт ли.Но мне кажется если чуток переделать в самый раз. <a href="http://forum.script-coding.com/viewtopic.php?id=10343">Посмотрите тут</a></p>]]></description>
			<author><![CDATA[null@example.com (Ядрён)]]></author>
			<pubDate>Tue, 09 Jan 2018 14:58:35 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=122887#p122887</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Открыть изображение, увеличить и получить координаты под курсором]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=122885#p122885</link>
			<description><![CDATA[<p><strong>serzh82saratov</strong>, да я вам. Спасибо за помощь.<br />Идеально было бы,если изображение увеличивалось-уменьшалось бы под курсором при помощи колесика мыши.</p>]]></description>
			<author><![CDATA[null@example.com (ser-bilichenko)]]></author>
			<pubDate>Tue, 09 Jan 2018 12:54:09 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=122885#p122885</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Открыть изображение, увеличить и получить координаты под курсором]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=122850#p122850</link>
			<description><![CDATA[<p>Если вы мне, то под картинкой имеется ввиду картинка экрана. Чтобы открыть файл картинки, надо конечно изменить код, может напишу если время будет.</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Mon, 08 Jan 2018 11:16:34 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=122850#p122850</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Открыть изображение, увеличить и получить координаты под курсором]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=122847#p122847</link>
			<description><![CDATA[<p>Я открыл картинку 6000*4000 и все равно показывает максимум это разрешение экрана. К сожалению возможно я делаю что-то не так.</p>]]></description>
			<author><![CDATA[null@example.com (ser-bilichenko)]]></author>
			<pubDate>Mon, 08 Jan 2018 11:03:52 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=122847#p122847</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Открыть изображение, увеличить и получить координаты под курсором]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=122841#p122841</link>
			<description><![CDATA[<p>Так вы когда двигаете картинку, там и есть координаты изображения.</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Mon, 08 Jan 2018 10:54:28 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=122841#p122841</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Открыть изображение, увеличить и получить координаты под курсором]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=122836#p122836</link>
			<description><![CDATA[<p>Спасибо за помощь. Почти так. Но нужны координаты не экрана, а координаты изображения.</p>]]></description>
			<author><![CDATA[null@example.com (ser-bilichenko)]]></author>
			<pubDate>Mon, 08 Jan 2018 10:48:23 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=122836#p122836</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Открыть изображение, увеличить и получить координаты под курсором]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=122831#p122831</link>
			<description><![CDATA[<p>Считайте что экран это картинка, после паузы можете её двигать. Вместо экрана можно и картинку открывать, используя GDI+. <br />Вот с координатами.<br /></p><div class="codebox"><pre><code>
	;	http://forum.script-coding.com/viewtopic.php?id=11447

#NoEnv
#SingleInstance Force
#KeyHistory 0
ListLines Off
SetBatchLines,-1
OnExit(&quot;ZoomOnClose&quot;)
Try Menu, Tray, Icon, Shell32, 23
OnMessage(0xF, &quot;WM_Paint&quot;)
OnMessage(0x214, &quot;WM_SIZING&quot;)
OnMessage(0x0020, &quot;WM_SETCURSOR&quot;)
Global oZoom := {}

oZoom.Zoom := 4
oZoom.Mark := &quot;Cross&quot;		; Cross, Square, Grid, None

WinX := 1
WinY := 1
WinW := 300
WinH := 360

Gui, Zoom: +AlwaysOnTop +Resize -DPIScale +hwndhGui +LabelZoomOn
Gui, Zoom: Font, s12
Gui, Zoom: Color, F0F0F0
Gui, Zoom: Add, Slider, vSliderZoom gSliderZoom x8 Range1-50 w176 Center AltSubmit NoTicks, % oZoom.Zoom
Gui, Zoom: Add, Text, vTextZoom Center x+10 yp+3 w36, % oZoom.Zoom
Gui, Zoom: Font
Gui, Zoom: Add, Button, gChangeMark vChangeMark x+10 yp w52, % oZoom.Mark
Gui, Dev: +HWNDhDev -Caption -DPIScale +Parent%hGui%
Gui, Dev: Add, Pic, hwndhDevCon
Gui, Dev: Show, NA
Gui, Dev: Color, ffffff

; Gui, Zoom: Show, x%WinX% y%WinY% w%WinW% h%WinH%, Magnify
Gui, Zoom: Show, NA w%WinW% h%WinH%, Magnify
Gui, Zoom: +MinSize

oZoom.hdcSrc := DllCall(&quot;GetDC&quot;, &quot;Ptr&quot;, 0)
oZoom.hdcDest := DllCall(&quot;GetDC&quot;, &quot;Ptr&quot;, hDevCon, &quot;Ptr&quot;)
oZoom.hdcMemory := DllCall(&quot;CreateCompatibleDC&quot;, &quot;Ptr&quot;, 0)
DllCall(&quot;Gdi32.Dll\SetStretchBltMode&quot;, &quot;Ptr&quot;, oZoom.hdcDest, &quot;Int&quot;, 4)
oZoom.hGui := hGui
oZoom.hDev := hDev
oZoom.hDevCon := hDevCon
Return

#If !oZoom.Minimize

+Up::MouseStep(0, -1)
+Down::MouseStep(0, 1)
+Left::MouseStep(-1, 0)
+Right::MouseStep(1, 0)

#If oZoom.Pause
^Up::
^DoWn::
WheelUp::
WheelDown::ChangeZoom(InStr(A_ThisHotKey, &quot;DoWn&quot;) ? oZoom.Zoom + 1 : oZoom.Zoom - 1)
#If

Pause::
1:: oZoom.Pause := !oZoom.Pause

#If

Magnify() {
	If (!oZoom.Pause &amp;&amp; !oZoom.Minimize &amp;&amp; !oZoom.Sizing)
	{
		MouseGetPos, , , WinID
		If (WinID != oZoom.hGui)
		{
			SetTimer, Memory, Off
			DllCall(&quot;GetCursorPos&quot;, &quot;int64P&quot;, pt)
			oZoom.MouseX := pt &lt;&lt; 32 &gt;&gt; 32, oZoom.MouseY := pt &gt;&gt; 32
			StretchBlt(oZoom.hdcDest, 0, 0, oZoom.nWidthDest, oZoom.nHeightDest
				, oZoom.hdcSrc, oZoom.MouseX - oZoom.nXOriginSrcOffset, oZoom.MouseY - oZoom.nYOriginSrcOffset, oZoom.nWidthSrc, oZoom.nHeightSrc)
			For k, v In oZoom.oMarkers[oZoom.Mark]
				StretchBlt(oZoom.hdcDest, v.x, v.y, v.w, v.h, oZoom.hdcDest, v.x, v.y, v.w, v.h, 0x5A0049)	; PATINVERT
			Gui, Zoom: Show, NA, % &quot;Magnify   x&quot; oZoom.MouseX + 1 &quot; y&quot; oZoom.MouseY + 1
			SetTimer, Memory, -30
		}
	}
	SetTimer, Magnify, -10
}

Memory() {
	SysGet, VirtualScreenX, 76
	SysGet, VirtualScreenY, 77
	SysGet, VirtualScreenWidth, 78
	SysGet, VirtualScreenHeight, 79
	oZoom.nXOriginSrc := oZoom.MouseX - VirtualScreenX, oZoom.nYOriginSrc := oZoom.MouseY - VirtualScreenY
	hBM := DllCall(&quot;Gdi32.Dll\CreateCompatibleBitmap&quot;, &quot;Ptr&quot;, oZoom.hdcSrc, &quot;Int&quot;, VirtualScreenWidth, &quot;Int&quot;, VirtualScreenHeight)
	DllCall(&quot;Gdi32.Dll\SelectObject&quot;, &quot;Ptr&quot;, oZoom.hdcMemory, &quot;Ptr&quot;, hBM), DllCall(&quot;DeleteObject&quot;, &quot;Ptr&quot;, hBM)
	BitBlt(oZoom.hdcMemory, 0, 0, VirtualScreenWidth, VirtualScreenHeight, oZoom.hdcSrc, VirtualScreenX, VirtualScreenY)
	oZoom.VirtualScreenWidth := VirtualScreenWidth, oZoom.VirtualScreenHeight := VirtualScreenHeight
}

Redraw() {
	StretchBlt(oZoom.hdcDest, 0, 0, oZoom.nWidthDest, oZoom.nHeightDest
		, oZoom.hdcMemory, oZoom.nXOriginSrc - oZoom.nXOriginSrcOffset, oZoom.nYOriginSrc - oZoom.nYOriginSrcOffset, oZoom.nWidthSrc, oZoom.nHeightSrc)
	For k, v In oZoom.oMarkers[oZoom.Mark]
		StretchBlt(oZoom.hdcDest, v.x, v.y, v.w, v.h, oZoom.hdcDest, v.x, v.y, v.w, v.h, 0x5A0049)	; PATINVERT
}

SetSize() {
	Critical
	Static Top := 60, Left := 0, Right := 0, Bottom := 0
	SetTimer, Magnify, Off
	GetClientPos(oZoom.hGui, GuiWidth, GuiHeight)
	Width := GuiWidth - Left - Right
	Height := GuiHeight - Top - Bottom
	Zoom := oZoom.Zoom
	conW := Mod(Width, Zoom) ? Width - Mod(Width, Zoom) + Zoom : Width
	conW := Mod(conW // Zoom, 2) ? conW : conW + Zoom
	conH := Mod(Height, Zoom) ? Height - Mod(Height, Zoom) + Zoom : Height
	conH := Mod(conH // Zoom, 2) ? conH : conH + Zoom
	conX := ((conW - Width) // 2) * -1
	conY := ((conH - Height) // 2) * -1

	oZoom.nWidthSrc := conW // Zoom
	oZoom.nHeightSrc := conH // Zoom
	oZoom.nXOriginSrcOffset := oZoom.nWidthSrc // 2
	oZoom.nYOriginSrcOffset := oZoom.nHeightSrc // 2
	oZoom.nWidthDest := nWidthDest := conW
	oZoom.nHeightDest := nHeightDest := conH
	xCenter := conW / 2 - Zoom / 2
	yCenter := conH / 2 - Zoom / 2

	oZoom.oMarkers[&quot;Cross&quot;] := [{x:0,y:yCenter - 1,w:nWidthDest,h:1}
		, {x:0,y:yCenter + Zoom,w:nWidthDest,h:1}
		, {x:xCenter - 1,y:0,w:1,h:nHeightDest}
		, {x:xCenter + Zoom,y:0,w:1,h:nHeightDest}]

	oZoom.oMarkers[&quot;Square&quot;] := [{x:xCenter - 1,y:yCenter,w:Zoom + 2,h:1}
		, {x:xCenter - 1,y:yCenter + Zoom + 1,w:Zoom + 2,h:1}
		, {x:xCenter - 1,y:yCenter + 1,w:1,h:Zoom}
		, {x:xCenter + Zoom,y:yCenter + 1,w:1,h:Zoom}]

	oZoom.oMarkers[&quot;Grid&quot;] := Zoom = 1 ? oZoom.oMarkers[&quot;Square&quot;]
		: [{x:xCenter - Zoom,y:yCenter - Zoom,w:Zoom * 3,h:1}
		, {x:xCenter - Zoom,y:yCenter,w:Zoom * 3,h:1}
		, {x:xCenter - Zoom,y:yCenter + Zoom,w:Zoom * 3,h:1}
		, {x:xCenter - Zoom,y:yCenter + Zoom * 2,w:Zoom * 3,h:1}
		, {x:xCenter - Zoom,y:yCenter - Zoom,w:1,h:Zoom * 3}
		, {x:xCenter,y:yCenter - Zoom,w:1,h:Zoom * 3}
		, {x:xCenter + Zoom,y:yCenter - Zoom,w:1,h:Zoom * 3}
		, {x:xCenter + Zoom * 2,y:yCenter - Zoom,w:1,h:Zoom * 3}]

	SetWindowPos(oZoom.hDevCon, conX, conY, conW, conH)
	SetWindowPos(oZoom.hDev, Left, Top, Width, Height)
	Redraw()
	SetTimer, Magnify, -10
}

SetWindowPos(hWnd, x, y, w, h) {
	Static SWP_ASYNCWINDOWPOS := 0x4000, SWP_DEFERERASE := 0x2000, SWP_NOACTIVATE := 0x0010, SWP_NOCOPYBITS := 0x0100
		, SWP_NOOWNERZORDER := 0x0200, SWP_NOREDRAW := 0x0008, SWP_NOSENDCHANGING := 0x0400
		, uFlags := SWP_ASYNCWINDOWPOS|SWP_DEFERERASE|SWP_NOACTIVATE|SWP_NOCOPYBITS|SWP_NOOWNERZORDER|SWP_NOREDRAW|SWP_NOSENDCHANGING
	DllCall(&quot;SetWindowPos&quot;
		, &quot;Ptr&quot;, hWnd
		, &quot;Ptr&quot;, 0
		, &quot;Int&quot;, x
		, &quot;Int&quot;, y
		, &quot;Int&quot;, w
		, &quot;Int&quot;, h
		, &quot;UInt&quot;, uFlags)
}

ZoomOnSize() {
	If A_EventInfo != 1
	{
		oZoom.Minimize := 0
		SetTimer, SetSize, -10
	}
	Else
		oZoom.Minimize := 1
}

SliderZoom() {
	GuiControlGet, SliderZoom, Zoom:
	ChangeZoom(SliderZoom)
}

ChangeZoom(Val) {
	If (Val &lt; 1 || Val &gt; 50)
		Return
	SetTimer, Magnify, Off
	GuiControl, Zoom:, TextZoom, % oZoom.Zoom := Val
	If A_GuiControl =
		GuiControl, Zoom:, SliderZoom, % oZoom.Zoom
	SetTimer, SetSize, -10
}

ChangeMark() {
	oZoom.Mark := [&quot;Cross&quot;,&quot;Square&quot;,&quot;Grid&quot;,&quot;None&quot;][{&quot;Cross&quot;:2,&quot;Square&quot;:3,&quot;Grid&quot;:4,&quot;None&quot;:1}[oZoom.Mark]]
	GuiControl, Zoom:, ChangeMark, % oZoom.Mark
	Redraw()
}

ZoomOnClose() {
	ZoomOnEscape:
		DllCall(&quot;Gdi32.Dll\DeleteDC&quot;, &quot;Ptr&quot;, oZoom.hdcDest)
		DllCall(&quot;Gdi32.Dll\DeleteDC&quot;, &quot;Ptr&quot;, oZoom.hdcSrc)
		DllCall(&quot;Gdi32.Dll\DeleteDC&quot;, &quot;Ptr&quot;, oZoom.hdcMemory)
		RestoreCursors()
		ExitApp
}

GetClientPos(hwnd, ByRef W, ByRef H)  {
	VarSetCapacity(pwi, 60, 0), NumPut(60, pwi, 0, &quot;UInt&quot;)
	DllCall(&quot;GetWindowInfo&quot;, &quot;Ptr&quot;, hwnd, &quot;UInt&quot;, &amp;pwi)
	W := NumGet(pwi, 28, &quot;Int&quot;) - NumGet(pwi, 20, &quot;Int&quot;)
	H := NumGet(pwi, 32, &quot;Int&quot;) - NumGet(pwi, 24, &quot;Int&quot;)
}

WM_Paint() {
	If A_GuiControl =
		SetTimer, Redraw, -30
}

WM_SIZING() {
	SetTimer, Magnify, Off
	oZoom.Sizing := 1
	SetTimer, NoSizing, 10
}

NoSizing() {
	If GetKeyState(&quot;LButton&quot;, &quot;P&quot;)
		Return
	oZoom.Sizing := 0
	SetTimer, NoSizing, Off
	SetTimer, Magnify, -10
}

BitBlt(ddc, dx, dy, dw, dh, sdc, sx, sy, Raster = 0xC000CA) {
	Return DllCall(&quot;Gdi32.Dll\BitBlt&quot;
		, &quot;Ptr&quot;, dDC
		, &quot;Int&quot;, dx
		, &quot;Int&quot;, dy
		, &quot;Int&quot;, dw
		, &quot;Int&quot;, dh
		, &quot;Ptr&quot;, sDC
		, &quot;Int&quot;, sx
		, &quot;Int&quot;, sy
		, &quot;Uint&quot;, Raster)
}

StretchBlt(ddc, dx, dy, dw, dh, sdc, sx, sy, sw, sh, Raster = 0xC000CA) {
	Return DllCall(&quot;Gdi32.Dll\StretchBlt&quot;
		, &quot;Ptr&quot;, dDC
		, &quot;Int&quot;, dx
		, &quot;Int&quot;, dy
		, &quot;Int&quot;, dw
		, &quot;Int&quot;, dh
		, &quot;Ptr&quot;, sDC
		, &quot;Int&quot;, sx
		, &quot;Int&quot;, sy
		, &quot;Int&quot;, sw
		, &quot;Int&quot;, sh
		, &quot;Uint&quot;, Raster|0x40000000)
}

	; _________________________________________________ MoveHand _________________________________________________

WM_SETCURSOR(W, L, M, H) {
	If (oZoom.SIZING)
		Return
	If (oZoom.Pause &amp;&amp; W = oZoom.hDev &amp;&amp; GetKeyState(&quot;LButton&quot;, &quot;P&quot;))
	{
		SetTimer, Hand, -1
		Return oZoom.SIZING := 1
	}
}

Hand() {
	SetTimer, Magnify, Off
	DllCall(&quot;GetCursorPos&quot;, &quot;int64P&quot;, pt)
	oZoom.MoveHandX := pt &lt;&lt; 32 &gt;&gt; 32, oZoom.MoveHandY := pt &gt;&gt; 32
	oZoom.MoveXSrc := oZoom.nXOriginSrc, oZoom.MoveYSrc := oZoom.nYOriginSrc
	SetSystemCursor(&quot;HAND&quot;)
	SetTimer, MoveHand, 10
	KeyWait, LButton
	SetTimer, MoveHand, Off
	RestoreCursors()
	oZoom.SIZING := 0
	SetTimer, Magnify, -10
}

MoveHand() {
	Static PrnXOriginSrc, PrnYOriginSrc
	PrnXOriginSrc := oZoom.nXOriginSrc
	PrnYOriginSrc := oZoom.nYOriginSrc
	DllCall(&quot;GetCursorPos&quot;, &quot;int64P&quot;, pt)
	MouseX := pt &lt;&lt; 32 &gt;&gt; 32, MouseY := pt &gt;&gt; 32
	XOdds := oZoom.MoveHandX - MouseX
	XOff := XOdds &gt; 0 ? Floor(XOdds / oZoom.Zoom) : Ceil(XOdds / oZoom.Zoom)
	oZoom.nXOriginSrc := oZoom.MoveXSrc + XOff
	YOdds := oZoom.MoveHandY - MouseY
	YOff := YOdds &gt; 0 ? Floor(YOdds / oZoom.Zoom) : Ceil(YOdds / oZoom.Zoom)
	oZoom.nYOriginSrc := oZoom.MoveYSrc + YOff
	If (PrnXOriginSrc &lt;&gt; oZoom.nXOriginSrc || PrnYOriginSrc &lt;&gt; oZoom.nYOriginSrc)
		LimitsOriginSrc(), Redraw()
	Gui, Zoom: Show, NA, % &quot;Magnify   x&quot; oZoom.nXOriginSrc + 1 &quot; y&quot; oZoom.nYOriginSrc + 1
}

MoveStep(StepX, StepY) {
	oZoom.nXOriginSrc += StepX
	oZoom.nYOriginSrc += StepY
	LimitsOriginSrc(), Redraw()
}

LimitsOriginSrc() {
	X := oZoom.nXOriginSrc
	oZoom.nXOriginSrc := X &lt; 0 ? 0 : X &gt; oZoom.VirtualScreenWidth - 1 ? oZoom.VirtualScreenWidth - 1 : X
	Y := oZoom.nYOriginSrc
	oZoom.nYOriginSrc := Y &lt; 0 ? 0 : Y &gt; oZoom.VirtualScreenHeight - 1 ? oZoom.VirtualScreenHeight - 1 : Y
}

MouseStep(x, y) {
	If !oZoom.Pause
		MouseMove, x, y, 0, R
	Else
		MoveStep(x, y)
}

SetSystemCursor(CursorName, cx = 0, cy = 0) {
	Static SystemCursors := {ARROW:32512, IBEAM:32513, WAIT:32514, CROSS:32515, UPARROW:32516, SIZE:32640, ICON:32641, SIZENWSE:32642
					, SIZENESW:32643, SIZEWE:32644 ,SIZENS:32645, SIZEALL:32646, NO:32648, HAND:32649, APPSTARTING:32650, HELP:32651}
    Local CursorHandle, hImage, Name, ID
	If (CursorHandle := DllCall(&quot;LoadCursor&quot;, Uint, 0, Int, SystemCursors[CursorName]))
		For Name, ID in SystemCursors
			hImage := DllCall(&quot;CopyImage&quot;, Ptr, CursorHandle, Uint, 0x2, Int, cx, Int, cy, Uint, 0)
			, DllCall(&quot;SetSystemCursor&quot;, Ptr, hImage, Int, ID)
}

RestoreCursors() {
	Static SPI_SETCURSORS := 0x57
	DllCall(&quot;SystemParametersInfo&quot;, UInt, SPI_SETCURSORS, UInt, 0, UInt, 0, UInt, 0)
}
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Mon, 08 Jan 2018 09:37:43 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=122831#p122831</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Открыть изображение, увеличить и получить координаты под курсором]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=122828#p122828</link>
			<description><![CDATA[<p>Да именно почти как Paint, но Paint увеличивает всегда левый верхний угол и всегда активирован какой-то инструмент. Можно порисовать или стереть часть картинки. А вот с извлечением координат в StatusBar справляется идеально.</p>]]></description>
			<author><![CDATA[null@example.com (ser-bilichenko)]]></author>
			<pubDate>Mon, 08 Jan 2018 09:14:29 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=122828#p122828</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Открыть изображение, увеличить и получить координаты под курсором]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=122827#p122827</link>
			<description><![CDATA[<p><strong>ser-bilichenko</strong>, так это программа Paint умеет.</p>]]></description>
			<author><![CDATA[null@example.com (ypppu)]]></author>
			<pubDate>Mon, 08 Jan 2018 09:10:20 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=122827#p122827</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Открыть изображение, увеличить и получить координаты под курсором]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=122826#p122826</link>
			<description><![CDATA[<div class="quotebox"><cite>ser-bilichenko пишет:</cite><blockquote><p>Извините, но я не могу найти откуда загружается картинка.</p></blockquote></div><p>С экрана.</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Mon, 08 Jan 2018 09:06:53 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=122826#p122826</guid>
		</item>
	</channel>
</rss>
