<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; Нужна помощь с ImageSearch]]></title>
	<link rel="self" href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=15469&amp;type=atom" />
	<updated>2020-12-06T06:02:33Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.script-coding.com/viewtopic.php?id=15469</id>
		<entry>
			<title type="html"><![CDATA[Re: Нужна помощь с ImageSearch]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=143919#p143919" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong>&nbsp; отныне, Вы - мой личный Иисус Христос!</p>]]></content>
			<author>
				<name><![CDATA[pixel75]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=41268</uri>
			</author>
			<updated>2020-12-06T06:02:33Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=143919#p143919</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Нужна помощь с ImageSearch]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=140311#p140311" />
			<content type="html"><![CDATA[<p>Пара вариантов попроще:<br /></p><div class="codebox"><pre><code>filePath := &quot;D:\Images\MyPicture.jpg&quot;
if size := GetImageSize(filePath)
   MsgBox, % size.W . &quot;`n&quot; size.H

GetImageSize(imageFilePath) {
   if !hBitmap := LoadPicture(imageFilePath, &quot;GDI+&quot;) {
      MsgBox, Failed to load the image
      Return
   }
   VarSetCapacity(BITMAP, size := 4*4 + A_PtrSize*2, 0)
   DllCall(&quot;GetObject&quot;, &quot;Ptr&quot;, hBitmap, &quot;Int&quot;, size, &quot;Ptr&quot;, &amp;BITMAP)
   DllCall(&quot;DeleteObject&quot;, &quot;Ptr&quot;, hBitmap)
   Return { W: NumGet(BITMAP, 4, &quot;UInt&quot;), H: NumGet(BITMAP, 8, &quot;UInt&quot;) }
}</code></pre></div><div class="codebox"><pre><code>filePath := &quot;D:\Images\MyPicture.jpg&quot;
oSize := GetImageSize(filePath)
MsgBox, % oSize.W . &quot;`n&quot; oSize.H
ExitApp

GetImageSize(imageFilePath)  {
   Gui, New
   Gui, Add, Pic,, % imageFilePath
   GuiControlGet, Pic, Pos, Static1
   Gui, Destroy
   Return { W: PicW, H: PicH }
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2020-06-25T17:47:09Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=140311#p140311</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Нужна помощь с ImageSearch]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=140284#p140284" />
			<content type="html"><![CDATA[<p><strong>topk1s</strong></p><p>Вот пример получения информации о разрешении картинки, затем делим переменные на 2.</p><p>Обязательно для использования наличие GdiPlus.dll.</p><div class="codebox"><pre><code>Path := &quot;C:\0.jpg&quot;	; Путь к картинке (в кавычках)
Return


F2::
; Получить в переменную Info информацию в виде словаря W и H
Info := Img_Size(Path)	

; Отобразить содержимое словаря: Info.W и Info.H
ToolTip, % &quot;Ширина: &quot; . Info.W . &quot;`nВысота: &quot; . Info.H
Return



;Возвращает w,h картинки, принимает путь к файлу (в кавычках)	[Malcev]
;http://forum.script-coding.com/viewtopic.php?id=13846
Img_Size(File)
{
 pToken := Gdip_StartUp()
 pBitmap := Gdip_CreateBitmapFromFile(File)
; pBitmap := Gdip_CreateBitmapFromFile(&quot;c:\myImage.jpg&quot;)
 Gdip_GetImageDimensions(pBitmap, w, h)
 Gdip_DisposeImage(pBitmap)
 Gdip_ShutDown(pToken)
; MsgBox, % &quot;Width: &quot; w &quot; Height: &quot; h
 Return { W: W, H: H }
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[__Михаил__]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=40928</uri>
			</author>
			<updated>2020-06-24T18:19:49Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=140284#p140284</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Нужна помощь с ImageSearch]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=140238#p140238" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>__Михаил__ пишет:</cite><blockquote><p><strong>topk1s</strong><br />1) Если есть данные о размере - просто вычислить середину, не вижу проблемы.<br />2) FileInstall <a href="http://www.script-coding.com/AutoHotkey/Scripts.html">http://www.script-coding.com/AutoHotkey/Scripts.html</a></p></blockquote></div><p>Можете с первым помочь ? Не могу додуматься как это сделать.</p>]]></content>
			<author>
				<name><![CDATA[topk1s]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=40827</uri>
			</author>
			<updated>2020-06-23T09:22:28Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=140238#p140238</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Нужна помощь с ImageSearch]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=140224#p140224" />
			<content type="html"><![CDATA[<p><strong>topk1s</strong><br />1) Если есть данные о размере - просто вычислить середину, не вижу проблемы.<br />2) FileInstall <a href="http://www.script-coding.com/AutoHotkey/Scripts.html">http://www.script-coding.com/AutoHotkey/Scripts.html</a></p>]]></content>
			<author>
				<name><![CDATA[__Михаил__]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=40928</uri>
			</author>
			<updated>2020-06-21T19:25:16Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=140224#p140224</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Нужна помощь с ImageSearch]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=140219#p140219" />
			<content type="html"><![CDATA[<p>Открыл для себя новые возможности, сижу изучаю.</p><p>Нужна помощь с несколькими вопросами.<br />1) Imagesearch сохраняет верхние левые координаты найденного изображения. Можно ли как-то сместить их от края к центру ? У меня в игре он за край тянет, хотелось бы чтобы он как человек брал за центр.<br />2) Можно ли как-то изображения всунуть внутрь скомпилированого скрипта ? Чтобы они не рядом с скриптом были, а внутри ?</p>]]></content>
			<author>
				<name><![CDATA[topk1s]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=40827</uri>
			</author>
			<updated>2020-06-21T15:23:24Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=140219#p140219</id>
		</entry>
</feed>
