<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: GDIp рисовка линии по координатам]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=14097&amp;type=atom" />
	<updated>2018-09-07T18:17:05Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=14097</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: GDIp рисовка линии по координатам]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=128543#p128543" />
			<content type="html"><![CDATA[<p>Да, вы правы, поменял алгоритм, а именно Gdip_GraphicsClear(this.G) перенес в конец цикла, теперь все идеально работает как и задумывалось, всем спасибо за помощь! <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /><strong>MandarinKa02</strong></p>]]></content>
			<author>
				<name><![CDATA[wynallon]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39065</uri>
			</author>
			<updated>2018-09-07T18:17:05Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=128543#p128543</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: GDIp рисовка линии по координатам]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=128541#p128541" />
			<content type="html"><![CDATA[<p><span style="color: gray">Offtop: Вы в программировании давно? Ваш код?<br />Так-то, если вы новичок, код не ваш и вам вообще плевать, что оно такое, то я вам могу. Ну а если вы опытный программист(что маловероятно), то должны сами додуматься.</span></p><p>Проанализируйте кусочек кода, который выложили. Ошибка в нем, даже не ошибка, а неправильность действий алгоритма.</p>]]></content>
			<author>
				<name><![CDATA[MandarinKa02]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34409</uri>
			</author>
			<updated>2018-09-07T18:06:43Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=128541#p128541</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: GDIp рисовка линии по координатам]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=128538#p128538" />
			<content type="html"><![CDATA[<p>Кажется проблема в PixelSearch, x, y, 0, 570, 200, 760, 0xFFFFFF, 10, fast rgb</p>]]></content>
			<author>
				<name><![CDATA[wynallon]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39065</uri>
			</author>
			<updated>2018-09-07T17:03:34Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=128538#p128538</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: GDIp рисовка линии по координатам]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=128536#p128536" />
			<content type="html"><![CDATA[<p>Когда нашел<span class="postimg"><img src="https://pp.userapi.com/c845120/v845120499/e132e/TJ52SVzEI60.jpg" alt="https://pp.userapi.com/c845120/v845120499/e132e/TJ52SVzEI60.jpg" /></span><br />Когда не нашел<span class="postimg"><img src="https://pp.userapi.com/c845120/v845120499/e1342/IGTsQawQvz8.jpg" alt="https://pp.userapi.com/c845120/v845120499/e1342/IGTsQawQvz8.jpg" /></span></p>]]></content>
			<author>
				<name><![CDATA[wynallon]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39065</uri>
			</author>
			<updated>2018-09-07T15:30:19Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=128536#p128536</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: GDIp рисовка линии по координатам]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=128535#p128535" />
			<content type="html"><![CDATA[<p>Да пробовал уже, не помогает <img src="//forum.script-coding.com/img/smilies/sad.png" width="15" height="15" /><br /></p><div class="codebox"><pre><code>DrawLine() {
		Hotkey := RegExReplace(A_ThisHotkey, (A_IsUnicode = 1) ? &quot;(*UCP)^(\w* &amp; |\W*)&quot; : &quot;^(\w* &amp; |\W*)&quot;)
		While (GetKeyState(Hotkey, &quot;p&quot;) = 1) {
		Loop,
		{
			PixelSearch, x, y, 0, 570, 200, 760, 0xFFFFFF, 10, fast rgb
			If !ErrorLevel
            Gdip_GraphicsClear(this.G)
			Gdip_DrawLine(this.G, this.pPen, x, y, 200, 570)   ; draw new line
			UpdateLayeredWindow(this.hwnd, this.hdc)
            Sleep, 200
			If ErrorLevel
			Sleep, 1000
		}
		}
		}</code></pre></div><p><strong>MandarinKa02</strong></p>]]></content>
			<author>
				<name><![CDATA[wynallon]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39065</uri>
			</author>
			<updated>2018-09-07T15:21:42Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=128535#p128535</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: GDIp рисовка линии по координатам]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=128534#p128534" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>ErrorLevel<br />[v1.1.04+]: This command is able to throw an exception if there was a problem while searching. For more information, see Runtime Errors.</p><p>ErrorLevel is set to 0 if the color was found in the specified region, 1 if it was not found, or 2 if there was a problem that prevented the command from conducting the search.</p></blockquote></div>]]></content>
			<author>
				<name><![CDATA[MandarinKa02]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34409</uri>
			</author>
			<updated>2018-09-07T15:12:14Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=128534#p128534</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: GDIp рисовка линии по координатам]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=128533#p128533" />
			<content type="html"><![CDATA[<p>Тогда еще вопрос, вот собственно код. Ищет пиксель, находит, запоминает его x,y рисует линию к x200 y570 все отлично, но если не находит, он все равно рисует линию, но уже от x0, y0 до x200 y570.По задумке нужно что если пиксель не был найден, то он ничего не рисовал, продолжая поиск пикселя. Не могу понять почему так, хелп пожалуйста.<br /></p><div class="codebox"><pre><code>CoordMode, mouse,Screen
#IfWinActive Dota 2
MyLines := new c_DrawLinesOnScreen()
F1::MyLines.DrawLine()

Esc::ExitApp


#Include Gdip.ahk

Class c_DrawLinesOnScreen {      
	Lines := []
	__New(o=&quot;&quot;) {
		Gui, New, +Hwndhwnd
		Gui %hwnd%: -Caption +E0x80000 +ToolWindow +AlwaysOnTop +OwnDialogs +Hwndhwnd
		Gui %hwnd%: Show, NA
		hbm := CreateDIBSection(A_ScreenWidth, A_ScreenHeight), hdc := CreateCompatibleDC(), obm := SelectObject(hdc, hbm)      
		G := Gdip_GraphicsFromHDC(hdc)
		if (G &lt; 1)
			pToken := Gdip_Startup(), G := Gdip_GraphicsFromHDC(hdc), this.pToken := pToken
		Gdip_SetSmoothingMode(G, 4), Gdip_SetInterpolationMode(G, 7)
		PenColor := (o.PenColor) ? o.PenColor : &quot;ffff0000&quot;, PenWidth := (o.PenWidth) ? o.PenWidth : 3
		pPen := Gdip_CreatePen(&quot;0x&quot; PenColor, PenWidth)
		UpdateLayeredWindow(hwnd, hdc, 0, 0, A_ScreenWidth, A_ScreenHeight)
		this.hwnd := hwnd, this.hbm := hbm, this.hdc := hdc, this.obm := obm, this.G := G, this.pPen := pPen
	}</code></pre></div><p>Где-то тут ошибка <img src="//forum.script-coding.com/img/smilies/sad.png" width="15" height="15" /><br /></p><div class="codebox"><pre><code>DrawLine() {
		Hotkey := RegExReplace(A_ThisHotkey, (A_IsUnicode = 1) ? &quot;(*UCP)^(\w* &amp; |\W*)&quot; : &quot;^(\w* &amp; |\W*)&quot;)
		While (GetKeyState(Hotkey, &quot;p&quot;) = 1) {
		Loop,
		{
			PixelSearch, x, y, 0, 570, 200, 760, 0xFFFFFF, 10, fast rgb
            Gdip_GraphicsClear(this.G)
			Gdip_DrawLine(this.G, this.pPen, pLine.1, pLine.2, pLine.3, pLine.4)
			Gdip_DrawLine(this.G, this.pPen, x, y, 200, 570)   ; draw new line
			UpdateLayeredWindow(this.hwnd, this.hdc)
            Sleep, 200
}
}
}
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[wynallon]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39065</uri>
			</author>
			<updated>2018-09-07T15:03:05Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=128533#p128533</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: GDIp рисовка линии по координатам]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=128532#p128532" />
			<content type="html"><![CDATA[<p><span style="color: green">Нельзя, тема полезная.</span></p>]]></content>
			<author>
				<name><![CDATA[ypppu]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=5974</uri>
			</author>
			<updated>2018-09-07T14:33:42Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=128532#p128532</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: GDIp рисовка линии по координатам]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=128531#p128531" />
			<content type="html"><![CDATA[<p>Все работает, спасибо, можно тему закрыть?</p>]]></content>
			<author>
				<name><![CDATA[wynallon]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39065</uri>
			</author>
			<updated>2018-09-07T14:23:18Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=128531#p128531</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: GDIp рисовка линии по координатам]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=128266#p128266" />
			<content type="html"><![CDATA[<p>Так у нас тут вообще-то ahk.v1. v2 — это не основная ветка, для продвинутых пользователей.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2018-08-25T19:52:29Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=128266#p128266</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: GDIp рисовка линии по координатам]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=128265#p128265" />
			<content type="html"><![CDATA[<p>Извините, не правильно выразил мысль, скачал ahk.v2-gdip2017.С вопросом разобрался, полазав на ютубе нашел рисовалку на подобии paint, взял от туда пример кода, все работает.Спасибо всем за помощь!<strong>teadrinker</strong></p>]]></content>
			<author>
				<name><![CDATA[wynallon]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39065</uri>
			</author>
			<updated>2018-08-25T19:50:41Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=128265#p128265</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: GDIp рисовка линии по координатам]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=128179#p128179" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>wynallon пишет:</cite><blockquote><p>скачал с github-а v2</p></blockquote></div><p>Можете ссылку приложить, откуда скачивали? Не знаю, что за github-а v2.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2018-08-22T14:24:23Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=128179#p128179</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: GDIp рисовка линии по координатам]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=128178#p128178" />
			<content type="html"><![CDATA[<p>Добрый день, извините если что-то не так. Проблема была в том что скачал gdip 1.45, а он оказался не рабочим, позже скачал с github-а v2.Сейчас все работает, примеры я поразбирал, квадраты элипсы и круги научился выводить, а вот как простую линию заставить самой двигаться мозг не допирает. На англоязычных форумах подобных тем не нашел <img src="//forum.script-coding.com/img/smilies/sad.png" width="15" height="15" />. Если есть желание подскажите пожалуйста.<strong>teadrinker</strong></p>]]></content>
			<author>
				<name><![CDATA[wynallon]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39065</uri>
			</author>
			<updated>2018-08-22T14:21:18Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=128178#p128178</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: GDIp рисовка линии по координатам]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=128175#p128175" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>wynallon пишет:</cite><blockquote><p>никак не могу разобраться с gdip на ahk.</p></blockquote></div><div class="quotebox"><cite>wynallon пишет:</cite><blockquote><p>я скачал gdip.ahk сборку от tic с github, куда этот файл закинуть нужно?</p></blockquote></div><p>А как вы пытались разобраться, если ещё к тому времени даже библиотеку не скачали? Для начала разберитесь, куда её нужно положить, затем позапускайте примеры. Когда поймёте, как они работают, только тогда уже пытайтесь применять изученные функции. А пока что ваш вопрос немного не соответствует вашему уровню подготовки.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2018-08-22T13:57:06Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=128175#p128175</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: GDIp рисовка линии по координатам]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=128169#p128169" />
			<content type="html"><![CDATA[<p>Хорошо, спасибо!<strong>Malcev</strong></p>]]></content>
			<author>
				<name><![CDATA[wynallon]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39065</uri>
			</author>
			<updated>2018-08-22T10:55:57Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=128169#p128169</id>
		</entry>
</feed>
