<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: AnimateWindow и StretchBlt]]></title>
		<link>http://forum.script-coding.com/viewtopic.php?id=13334</link>
		<atom:link href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=13334&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: AnimateWindow и StretchBlt».]]></description>
		<lastBuildDate>Mon, 08 Jan 2018 20:51:50 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: AnimateWindow и StretchBlt]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=122884#p122884</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>Mon, 08 Jan 2018 20:51:50 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=122884#p122884</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: AnimateWindow и StretchBlt]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=122883#p122883</link>
			<description><![CDATA[<p>Так это от задачи зависит, зачем свежие данные, если спустя время нужно будет просмотреть прежний вид всего экрана.</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Mon, 08 Jan 2018 20:24:41 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=122883#p122883</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: AnimateWindow и StretchBlt]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=122882#p122882</link>
			<description><![CDATA[<p>Прежде всего скорость. И всё время свежие данные.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Mon, 08 Jan 2018 20:21:40 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=122882#p122882</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: AnimateWindow и StretchBlt]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=122877#p122877</link>
			<description><![CDATA[<p>Так всё же что это даёт?</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Mon, 08 Jan 2018 18:37:33 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=122877#p122877</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: AnimateWindow и StretchBlt]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=122862#p122862</link>
			<description><![CDATA[<p>В моём варианте, если ты заметил, данные берутся непосредственно с DC экрана.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Mon, 08 Jan 2018 13:34:11 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=122862#p122862</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: AnimateWindow и StretchBlt]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=122861#p122861</link>
			<description><![CDATA[<p>Так экран уже поменяется 100 раз.</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Mon, 08 Jan 2018 13:33:06 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=122861#p122861</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: AnimateWindow и StretchBlt]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=122860#p122860</link>
			<description><![CDATA[<div class="quotebox"><cite>serzh82saratov пишет:</cite><blockquote><p>Ну а если я захочу поставить на паузу, растянуть окно, и уменьшить зум, что я увижу?</p></blockquote></div><p>Думаю, это несколько избыточно, но решаемо. Просто сохранить последние координаты курсора, и при растягивании перерисовывать относительно этих координат по текущему размеру картинки.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Mon, 08 Jan 2018 13:32:05 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=122860#p122860</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: AnimateWindow и StretchBlt]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=122859#p122859</link>
			<description><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>Это не понял.</p></blockquote></div><p>Про WM_PAINT я отвечал.</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Mon, 08 Jan 2018 13:19:36 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=122859#p122859</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: AnimateWindow и StretchBlt]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=122858#p122858</link>
			<description><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>Это не понял.</p></blockquote></div><p>Вертикальная синхронизация. Картинка разъежается по горизонтали, это в основном в классической теме, и не сильно заметно, но изредка режет глаз.<br /></p><div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>А зачем это? Для перерисовки картинки нужен только её контент.</p></blockquote></div><p>Ну а если я захочу поставить на паузу, растянуть окно, и уменьшить зум, что я увижу?</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Mon, 08 Jan 2018 13:17:38 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=122858#p122858</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: AnimateWindow и StretchBlt]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=122857#p122857</link>
			<description><![CDATA[<div class="quotebox"><cite>serzh82saratov пишет:</cite><blockquote><p>Всё равно немного заметен вертикальный рассинхрон и WM_PAINT.</p></blockquote></div><p>Это не понял. </p><div class="quotebox"><cite>serzh82saratov пишет:</cite><blockquote><p>И в моём случае this.hMDC это DC всего экрана</p></blockquote></div><p>А зачем это? Для перерисовки картинки нужен только её контент.</p><div class="quotebox"><cite>serzh82saratov пишет:</cite><blockquote><p>Ещё не понятно, что у тебя показывается у краёв экрана.</p></blockquote></div><p>Ну просто не учтена эта ситуация, думаю, вопрос на пару строк кода.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Mon, 08 Jan 2018 13:13:06 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=122857#p122857</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: AnimateWindow и StretchBlt]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=122856#p122856</link>
			<description><![CDATA[<p>Ещё не понятно, что у тебя показывается у краёв экрана.</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Mon, 08 Jan 2018 13:03:09 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=122856#p122856</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: AnimateWindow и StretchBlt]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=122855#p122855</link>
			<description><![CDATA[<p>Всё равно немного заметен вертикальный рассинхрон и WM_PAINT в классической теме. И в моём случае this.hMDC это DC всего экрана, и WM_PAINT происходит медленне, плюс в цикле Draw уже неполучится каждый раз его сохранять.</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Mon, 08 Jan 2018 12:59:54 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=122855#p122855</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: AnimateWindow и StretchBlt]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=122854#p122854</link>
			<description><![CDATA[<div class="codebox"><pre><code>#NoEnv
SetBatchLines, -1

Gui, +hwndhGui +AlwaysOnTop -DPIScale
Gui, Margin, 20, 20
Gui, Add, Pic, w351 h351 hwndhPic border
Gui, Show,, Zoom: 5
oZoom := new Zoom(hPic)
Return

GuiClose:
   oZoom := &quot;&quot;
   ExitApp
   
#If WinActive(&quot;ahk_id&quot; . hGui)
WheelUp:: 
WheelDown:: Gui, Show,, % &quot;Zoom: &quot; . oZoom.ChangeZoom(A_ThisHotkey = &quot;WheelUp&quot;)
#If

class Zoom  {
   __New(hPic)  {
      CoordMode, Mouse
      this.hParent := DllCall(&quot;GetParent&quot;, Ptr, hPic)
      WinGetPos,,, W, H, ahk_id %hPic%
      this.PicWidth := W, this.PicHeight := H
      this.CurrentZoom := 5
      this.hDC := DllCall(&quot;GetDC&quot;, Ptr, hPic, Ptr)
      this.hSDC := DllCall(&quot;GetDC&quot;, Ptr, 0, Ptr)
      this.oMDC := new this.CompatibleDC(this.hDC, W, H)
      this.hMDC := this.oMDC.hCDC
      
      this.timer := timer := ObjBindMethod(this, &quot;Draw&quot;)
      SetTimer, % timer, 10
      OnMessage( 0xF, ObjBindMethod(this, &quot;WM_PAINT&quot;) )
   }
   
   __Delete()  {
      timer := this.timer
      SetTimer, % timer, Delete
      this.oMDC := &quot;&quot;
      DllCall(&quot;DeleteDC&quot;, Ptr, this.hDC)
      DllCall(&quot;DeleteDC&quot;, Ptr, this.hSDC)
   }
      
   Draw()  {
      MouseGetPos, mouse_x, mouse_y
      w := this.PicWidth/this.CurrentZoom
      h := this.PicHeight/this.CurrentZoom
      DllCall(&quot;StretchBlt&quot;, Ptr, this.hDC, Int, 0, Int, 0, Int, this.PicWidth - 2, int, this.PicHeight - 2
                          , Ptr, this.hSDC, Int, mouse_x - w/2, Int, mouse_y - h/2, Int, w, Int, h, UInt, SRCCOPY := 0xCC0020)
      this.BitBlt(this.hMDC, this.hDC)
   }
   
   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)
   }
   
   ChangeZoom(mode)  {
      this.CurrentZoom += (mode ? 1 : -1)
      (this.CurrentZoom &lt; 1 &amp;&amp; this.CurrentZoom := 1)
      Return this.CurrentZoom
   }
   
   WM_PAINT(wp, lp, msg, hwnd)  {
      if (this.hParent = hwnd)  {
         timer := ObjBindMethod(this, &quot;BitBlt&quot;, this.hDC, this.hMDC)
         SetTimer, % timer, -10
      }
   }
   
   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)
      }
   }
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Mon, 08 Jan 2018 12:40:53 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=122854#p122854</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: AnimateWindow и StretchBlt]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=122853#p122853</link>
			<description><![CDATA[<p>Ок, вечером.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Mon, 08 Jan 2018 11:18:56 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=122853#p122853</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: AnimateWindow и StretchBlt]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=122852#p122852</link>
			<description><![CDATA[<p>Ну тогда приведи свой код.</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Mon, 08 Jan 2018 11:18:23 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=122852#p122852</guid>
		</item>
	</channel>
</rss>
