<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Аналог PixelGetColor для перекрытого окна]]></title>
	<link rel="self" href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=15411&amp;type=atom" />
	<updated>2020-06-07T11:52:01Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.script-coding.com/viewtopic.php?id=15411</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Аналог PixelGetColor для перекрытого окна]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=140050#p140050" />
			<content type="html"><![CDATA[<p>Сначала сохраните то, что возвращает GetPixel(), в переменную, потом переменную сравнивайте.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2020-06-07T11:52:01Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=140050#p140050</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Аналог PixelGetColor для перекрытого окна]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=140049#p140049" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>Нужно использовать <strong>||</strong>.</p></blockquote></div><p>У меня не получается именно с GetPixel сделать также, я перепробовал, все что получалось с pixelgetcolor.</p><p>И все таки, как это сделать?)<br /></p><div class="codebox"><pre><code>if (GetPixel(hWnd, X, Y) = 0xFF0000 или 0xFF0055 или 0xFF1055)
{
Goto, label1
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Wraith]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=40888</uri>
			</author>
			<updated>2020-06-07T11:31:23Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=140049#p140049</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Аналог PixelGetColor для перекрытого окна]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=140048#p140048" />
			<content type="html"><![CDATA[<p>Нужно использовать <strong>||</strong>.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2020-06-07T10:32:38Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=140048#p140048</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Аналог PixelGetColor для перекрытого окна]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=140046#p140046" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>Не очень понял. В пикселе вы ничего не можете получить, можно получить только цвет пикселя, одного или нескольких.</p></blockquote></div><p>У меня так же не получается сделать.<br /></p><div class="codebox"><pre><code>PixelGetColor, color, 100, 100
if (color = 0xFF0000) | (color = 0xFF0055) | (color = 0xFF1055)
{
Goto,
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Wraith]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=40888</uri>
			</author>
			<updated>2020-06-07T08:49:59Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=140046#p140046</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Аналог PixelGetColor для перекрытого окна]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=140043#p140043" />
			<content type="html"><![CDATA[<p>Получить составляющие R, G, B по отдельности что ли?</p>]]></content>
			<author>
				<name><![CDATA[ypppu]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=5974</uri>
			</author>
			<updated>2020-06-07T05:43:26Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=140043#p140043</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Аналог PixelGetColor для перекрытого окна]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=140040#p140040" />
			<content type="html"><![CDATA[<p>Не очень понял. В пикселе вы ничего не можете получить, можно получить только цвет пикселя, одного или нескольких.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2020-06-06T19:57:08Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=140040#p140040</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Аналог PixelGetColor для перекрытого окна]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=140039#p140039" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong><br />В одном пикселе получить несколько разных цветов.</p>]]></content>
			<author>
				<name><![CDATA[Wraith]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=40888</uri>
			</author>
			<updated>2020-06-06T19:31:38Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=140039#p140039</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Аналог PixelGetColor для перекрытого окна]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=140037#p140037" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Wraith пишет:</cite><blockquote><p>как получить несколько разных пикселей?</p></blockquote></div><p>Получить несколько разных пикселей, или сравнить одно полученное значение с несколькими?</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2020-06-06T17:35:53Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=140037#p140037</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Аналог PixelGetColor для перекрытого окна]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=140035#p140035" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>;X := 0xFF0000
;X := 0xFF0055
X := 0xFF1055

IF (X = 0xFF0000) OR (X = 0xFF0055) OR (X = 0xFF1055)
MsgBox, X равен одному из перечисленных значений</code></pre></div>]]></content>
			<author>
				<name><![CDATA[ypppu]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=5974</uri>
			</author>
			<updated>2020-06-06T16:37:27Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=140035#p140035</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Аналог PixelGetColor для перекрытого окна]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=140033#p140033" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong><br />Я может быть тупой, но как получить несколько разных пикселей?<br /></p><div class="codebox"><pre><code>if (GetPixel(hWnd, X, Y) = 0xFF0000 или 0xFF0055 или 0xFF1055)
{
Goto, label1
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Wraith]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=40888</uri>
			</author>
			<updated>2020-06-06T10:38:26Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=140033#p140033</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Аналог PixelGetColor для перекрытого окна]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=140031#p140031" />
			<content type="html"><![CDATA[<p>Упустил момент, только насчет версий ОС заметил.</p>]]></content>
			<author>
				<name><![CDATA[stealzy]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=31937</uri>
			</author>
			<updated>2020-06-06T07:18:16Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=140031#p140031</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Аналог PixelGetColor для перекрытого окна]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=140030#p140030" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Malcev пишет:</cite><blockquote><p><strong>teadrinker</strong>, у тебя опечатка</p></blockquote></div><p>Поправил.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2020-06-05T23:47:53Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=140030#p140030</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Аналог PixelGetColor для перекрытого окна]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=140029#p140029" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>stealzy пишет:</cite><blockquote><p>Универсально</p></blockquote></div><p>Не универсально.<br />С hardware-accelerated окнами потестируйте.<br />С тем же хромом или WMP.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2020-06-05T23:23:02Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=140029#p140029</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Аналог PixelGetColor для перекрытого окна]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=140026#p140026" />
			<content type="html"><![CDATA[<p>Универсально и быстрее PrintWindow для десятка пикселей:<br /></p><div class="codebox"><pre><code>; клиентские координаты интересующих пикселей
x1 := 1000, y1 := 10
x2 := 1000, y2 := 20
hWnd := WinExist(&quot;A&quot;) ; идентификация окна
WinPos := WinGetP(hWnd) ; координаты клиентской области окна
;=====================================================
hDC   := Window_CreateCapture(hWnd) ; снимок окна

pix1 := Client_GetPixel(hDC, x1, y1, WinPos)
pix2 := Client_GetPixel(hDC, x2, y2, WinPos)

Window_DeleteWindowCapture(hWnd, hDC) ; удаление снимка
;=====================================================
MsgBox % Format(&quot;{:#0x}&quot;, pix1) &quot; &quot; Format(&quot;{:#0x}&quot;, pix2) ; формат BGR hex
Return

Window_CreateCapture(hwnd) {
	Return DllCall(&quot;user32.dll\GetDCEx&quot;, &quot;UInt&quot;, hwnd, &quot;UInt&quot;, 0, &quot;UInt&quot;, 1|2)
} ; 1|2|8|16 — флаги ставим по документации GetDCEx на msdn
Client_GetPixel(hDC, x, y, WinPos) {
	Return DllCall(&quot;gdi32.dll\GetPixel&quot;, &quot;UInt&quot;, hDC, &quot;Int&quot;, x+WinPos.Client2Win.x, &quot;Int&quot;, y+WinPos.Client2Win.y, &quot;UInt&quot;)
}
Window_DeleteWindowCapture(hwnd, hDC) {
	Return DllCall(&quot;user32.dll\ReleaseDC&quot;, &quot;UInt&quot;, hwnd, &quot;UInt&quot;, hDC)
}
WinGetP(hwnd) {
	WinGetPos, x_W, y_W, w_W, h_W, % &quot;ahk_id &quot; hWnd
	VarSetCapacity(pt, 16)
	NumPut(x, pt, 0) || NumPut(y, pt, 4) || NumPut(w, pt, 8) || NumPut(h, pt, 12)
	if !DllCall(&quot;GetClientRect&quot;, UInt, hWnd, UInt, &amp;pt)
		Return
	if !DllCall(&quot;ClientToScreen&quot;, UInt, hWnd, UInt, &amp;pt)
		Return
	x := NumGet(pt, 0, Int), y := NumGet(pt, 4, Int)
	w := NumGet(pt, 8, Int), h := NumGet(pt, 12, Int)
	Client := {x:x, y:y, w:w, h:h}, Client2Win := {x:x-x_W, y:y-y_W, w:w, h:h}
	Return WinP := {x:x_W, y:y_W, w:w_W, h:h_W, Client2Win:Client2Win, Client:Client}
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[stealzy]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=31937</uri>
			</author>
			<updated>2020-06-05T22:21:21Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=140026#p140026</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Аналог PixelGetColor для перекрытого окна]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=140024#p140024" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong>, у тебя опечатка:<br /></p><div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>DllCall(&quot;ReleaseDC&quot;, &quot;Ptr&quot;, <strong>ahk_id %hWnd%</strong>, &quot;Ptr&quot;, hDC)</p></blockquote></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2020-06-05T20:15:22Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=140024#p140024</id>
		</entry>
</feed>
