<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK:экранная лупа - управление зумом]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=8702&amp;type=atom" />
	<updated>2013-09-27T11:25:44Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=8702</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK:экранная лупа - управление зумом]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=75582#p75582" />
			<content type="html"><![CDATA[<p>Впиши нужные координаты вместо переменных, там где меняются координаты.<br /></p><div class="codebox"><pre><code>MouseGetPos,x,y,mwin,mctrl</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Alectric]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26027</uri>
			</author>
			<updated>2013-09-27T11:25:44Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=75582#p75582</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK:экранная лупа - управление зумом]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=75559#p75559" />
			<content type="html"><![CDATA[<p>Нужно что бы окно лупы показывало центр экрана и при движении курсора не куда не двигалось но при этом можно было менять зум клавишами&nbsp; ^WheelUp:: уменьшить<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;^WheelDown:: увеличить.</p>]]></content>
			<author>
				<name><![CDATA[Ядрён]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=30092</uri>
			</author>
			<updated>2013-09-25T16:23:09Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=75559#p75559</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK:экранная лупа - управление зумом]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=75556#p75556" />
			<content type="html"><![CDATA[<p>Вот держи:</p><div class="codebox"><pre><code>#NoEnv
#NoTrayIcon
SetBatchLines -1
OnExit,GuiClose
SetFormat,float,6.0
SysGet,w,MonitorWorkArea
wbottom+=30
zoom=4
Rx=128
Ry=128
Zx:=Rx/zoom
Zy:=Ry/zoom
paused=0
start=1

Gui,3:-Caption +Border +ToolWindow +AlwaysOnTop
Gui,3:Color,EEEEEE
Gui,3:Margin,0,0
Gui +AlwaysOnTop +Resize +ToolWindow
Gui,Show, % &quot;w&quot; 2*Rx &quot; h&quot; 2*Ry &quot; x0 y0&quot;,Увеличительное окно.
WinGet,ID,id,Увеличительное окно.
WinGet,PrintSourceID,ID
hdd_frame:=DllCall(&quot;GetDC&quot;,UInt,PrintSourceID)
hdc_frame:=DllCall(&quot;GetDC&quot;,UInt,ID)

GuiSize:
loop
{
sleep,10

GetKeyState,rctrl,rctrl,P
if (rctrl=&quot;D&quot;)
{
  if paused=0
  {
    Gui,Hide
    Gui,3:Hide
    paused=1
    sleep,500
    tooltip,
  }
  else
  {
    pausedchek=0
    Gui,Show
    paused=0
    sleep,500
  }
}

if paused=0
{
WinGetPos,winx,winy,Wn,Hn,Увеличительное окно.
wn-=8
Hn-=26
Rx:=Wn/2
Ry:=Hn/2
Zx:=Rx/zoom
Zy:=Ry/zoom
CoordMode,Mouse,Screen
MouseGetPos,x,y,mwin,mctrl
xz:=In(x-Zx-6,0,wright-2*Zx)
yz:=In(y-Zy-6,0,wbottom-2*Zy)
ifwinnotactive,Увеличительное окно.
{
  DllCall(&quot;gdi32.dll\StretchBlt&quot;,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)
  tooltip,
}
else
{
  CoordMode,tooltip,Screen
  tooltip,Увеличение - %zoom%00 `%`nВ кадре %ww% x %hh% пикселей`nПравый Ctrl - скрыть\показать.`nЛевый Ctrl+Колесо мыши - масштаб.,%winx%,%winy%
}
ww=%Zx%
hh=%Zy%
ww*=2
hh*=2
xx=%xz%
yy=%yz%
xx-=1
yy-=1
Gui,3:Show,x%xx% y%yy% w%ww% h%hh% NoActivate,Рамка
WinGet,guiid,ID,Рамка
WinSet,TransColor,EEEEEE,ahk_id %guiid%
ifwinactive,Рамка
{
  zoom-=1
  winactivate,ahk_class Shell_TrayWnd
}

In(x,a,b)
{
   IfLess x,%a%,Return a
   IfLess b,%x%,Return b
   Return x
}

}
else
  sleep,100
}
Return

^WheelUp::
^WheelDoWn::
If (A_ThisHotKey=&quot;^WheelUp&quot;)
  zoom+=1
If (A_ThisHotKey=&quot;^WheelDoWn&quot;)
  zoom-=1
if zoom&lt;1
  zoom=1
if zoom&gt;35
  zoom=35
Zx:=Rx/zoom
Zy:=Ry/zoom
Return

GuiClose:
DllCall(&quot;gdi32.dll\DeleteDC&quot;,UInt,hdc_frame)
DllCall(&quot;gdi32.dll\DeleteDC&quot;,UInt,hdd_frame)
ExitApp
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Alectric]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26027</uri>
			</author>
			<updated>2013-09-25T15:14:26Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=75556#p75556</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK:экранная лупа - управление зумом]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=75555#p75555" />
			<content type="html"><![CDATA[<p>Доброго времени суток. Помогите добавить в скрипт управление зумом от минимума к максимуму на горячие клавиши. </p><p>^WheelUp:: уменьшить<br />^WheelDown:: увеличить</p><div class="codebox"><pre><code>#NoEnv
SetBatchLines, -1
CoordMode, Pixel
DllCall(&quot;dwmapi\DwmEnableComposition&quot;, &quot;UInt&quot;, False)
Gui, +AlwaysOnTop -Caption +E0x80000 +HwndGUIhWnd +Owner
Gui, Show, w150 h150, 10xZoom
WinMove, % &quot;ahk_id&quot;GUIhWnd,, A_ScreenWidth//2-76, A_ScreenHeight//2-76
hModule:=DllCall(&quot;LoadLibrary&quot;, &quot;Str&quot;, &quot;gdiplus.dll&quot;)
VarSetCapacity(GdiplusStartupInput, 16, 0)
NumPut(1, GdiplusStartupInput, 0, &quot;Char&quot;)
DllCall(&quot;gdiplus\GdiplusStartup&quot;, &quot;UInt*&quot;, pToken, &quot;UInt&quot;, &amp;GdiplusStartupInput)
VarSetCapacity(BITMAPINFO, 40, 0)
NumPut(40, BITMAPINFO, 0)
NumPut(150, BITMAPINFO, 4) ; biWidth
NumPut(150,BITMAPINFO, 8) ; biHeight
NumPut(1, BITMAPINFO, 12, &quot;UShort&quot;)
NumPut(32, BITMAPINFO, 14, &quot;UShort&quot;)
NumPut(0, BITMAPINFO, 16)
hBitmap:=DllCall(&quot;CreateDIBSection&quot;, &quot;UInt&quot;, hDC
                                   , &quot;UInt&quot;, &amp;BITMAPINFO
                                   , &quot;UInt&quot;, 0
                                   , &quot;UInt*&quot;, 0
                                   , &quot;UInt&quot;, 0
                                   , &quot;UInt&quot;, 0)
DllCall(&quot;ReleaseDC&quot;, &quot;UInt&quot;, 0, &quot;UInt&quot;, hDC)
hMemDC:=DllCall(&quot;CreateCompatibleDC&quot;, &quot;UInt&quot;, 0)
DllCall(&quot;SelectObject&quot;, &quot;UInt&quot;, hMemDC, &quot;UInt&quot;, hBitmap)
DllCall(&quot;gdiplus\GdipCreateFromHDC&quot;, &quot;UInt&quot;, hMemDC, &quot;UInt*&quot;, pGraphics)
DllCall(&quot;gdiplus\GdipCreateSolidFill&quot;, &quot;Int&quot;, Color1, &quot;UInt*&quot;, pBrush)
SetTimer, UpdWindow, 50
OnExit, ExitScript
Return

UpdWindow:
   Loop, 15
      GdipDrawLine(A_Index-1)
   DllCall(&quot;UpdateLayeredWindow&quot;, &quot;UInt&quot;, GUIhWnd
                                , &quot;UInt&quot;, 0
                                , &quot;UInt&quot;, 0
                                , &quot;Int64*&quot;, 0x09600000096 ; 150x150
                                , &quot;UInt&quot;, hMemDC
                                , &quot;Int64*&quot;, 0
                                , &quot;UInt&quot;, 0
                                , &quot;UInt*&quot;, 0x01FF0000
                                , &quot;UInt&quot;, 2)
   Return

ExitScript:
   DllCall(&quot;gdiplus\GdiplusShutdown&quot;, &quot;UInt&quot;, pToken)
   DllCall(&quot;FreeLibrary&quot;, &quot;UInt&quot;, hModule)
   DllCall(&quot;dwmapi\DwmEnableComposition&quot;, &quot;UInt&quot;, True)
   ExitApp

GdipDrawLine(Y)
{
   global
   Loop, 15
   {
      PixelGetColor, CurrentColor, A_ScreenWidth//2-7+A_Index-1
                                 , A_ScreenHeight//2-7+Y, RGB
      DllCall(&quot;gdiplus\GdipSetSolidFillColor&quot;, &quot;UInt&quot;, pBrush
                                             , &quot;UInt&quot;, CurrentColor|0xFF000000)
      DllCall(&quot;gdiplus\GdipFillRectangle&quot;, &quot;UInt&quot;, pGraphics
                                         , &quot;UInt&quot;, pBrush
                                         , &quot;Float&quot;, (A_Index-1)*10
                                         , &quot;Float&quot;, Y*10
                                         , &quot;Float&quot;, 10
                                         , &quot;Float&quot;, 10)
   }
}</code></pre></div><p>Здесь <a href="http://forum.script-coding.com/viewtopic.php?id=6638">http://forum.script-coding.com/viewtopic.php?id=6638</a>&nbsp; смотрел ,пытался разобраться не получилось, помогите&nbsp; пожалуйста .</p>]]></content>
			<author>
				<name><![CDATA[Ядрён]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=30092</uri>
			</author>
			<updated>2013-09-25T15:07:10Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=75555#p75555</id>
		</entry>
</feed>
