<?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=13846&amp;type=atom" />
	<updated>2018-06-13T23:38:11Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=13846</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK : Информация о файле]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=125999#p125999" />
			<content type="html"><![CDATA[<p>Да, действительно, через GDI+ быстрее. Но мой вариант зато без сторонних библиотек.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2018-06-13T23:38:11Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=125999#p125999</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK : Информация о файле]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=125991#p125991" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>Ну, если уж по-умному, и как быстрее,</p></blockquote></div><p>Замерил скорости (13 mb небитый jpg):<br /></p><div class="quotebox"><blockquote><p>LoadPicture(imageFilePath, &quot;GDI+&quot;) - 200 ms<br />LoadPicture(imageFilePath) - 700 ms<br />Gdip_CreateBitmapFromFile(&quot;c:\myImage.jpg&quot;) - 30 ms</p></blockquote></div><p>Файлы:<br /><a href="https://ru.files.fm/u/59dw8vw8">https://ru.files.fm/u/59dw8vw8</a></p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2018-06-13T23:07:02Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=125991#p125991</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK : Информация о файле]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=125990#p125990" />
			<content type="html"><![CDATA[<p>У меня даже не на чем попробовать.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2018-06-13T23:00:32Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=125990#p125990</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK : Информация о файле]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=125988#p125988" />
			<content type="html"><![CDATA[<p>А битый файл зрительно можно и не отличить.<br />Например битый jpg&nbsp; без видимых битых пикселов может прекрасно открываться в пейнте.<br />Кстати, с опцией GDI+ открывает.<br /></p><div class="codebox"><pre><code>hBitmap := LoadPicture(imageFilePath, &quot;GDI+&quot;)</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2018-06-13T22:51:45Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=125988#p125988</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK : Информация о файле]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=125987#p125987" />
			<content type="html"><![CDATA[<p>Да и ну их, эти битые файлы, кому они нужны. <img src="//forum.script-coding.com/img/smilies/lol.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2018-06-13T22:48:33Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=125987#p125987</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK : Информация о файле]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=125985#p125985" />
			<content type="html"><![CDATA[<p>Неа, LoadPicture с битыми файлами не работает.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2018-06-13T22:44:18Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=125985#p125985</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK : Информация о файле]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=125983#p125983" />
			<content type="html"><![CDATA[<p>Ну, если уж по-умному, и как быстрее, то лучше так:<br /></p><div class="codebox"><pre><code>filePath := &quot;D:\Images\MyPicture.png&quot;
if oSize := GetImageSize(filePath)
   MsgBox, % oSize.W . &quot;`n&quot; oSize.H

GetImageSize(imageFilePath)  {
   if !hBitmap := LoadPicture(imageFilePath)  {
      MsgBox, Не удалось получить hBitmap
      Return
   }
   VarSetCapacity(BITMAP, size := 4*4 + A_PtrSize*2, 0)
   DllCall(&quot;GetObject&quot;, Ptr, hBitmap, Int, size, Ptr, &amp;BITMAP)
   DllCall(&quot;DeleteObject&quot;, Ptr, hBitmap)
   Return { W: NumGet(BITMAP, 4, &quot;UInt&quot;), H: NumGet(BITMAP, 8, &quot;UInt&quot;) }
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2018-06-13T22:42:13Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=125983#p125983</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK : Информация о файле]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=125982#p125982" />
			<content type="html"><![CDATA[<p>Я бы таким способом не пользовался, так как картинка может в гуи не загрузиться (например из-за битого кодека).<br />Надёжней и быстрее так:<br /></p><div class="codebox"><pre><code>pToken := Gdip_StartUp()
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</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2018-06-13T22:35:59Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=125982#p125982</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK : Информация о файле]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=125981#p125981" />
			<content type="html"><![CDATA[<p>Проще всего так:<br /></p><div class="codebox"><pre><code>filePath := &quot;D:\Images\MyPicture.png&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>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2018-06-13T22:00:06Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=125981#p125981</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK : Информация о файле]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=125979#p125979" />
			<content type="html"><![CDATA[<p>Хочется узнать можно ли определить размер картинки, в пикселях.</p>]]></content>
			<author>
				<name><![CDATA[qqlexa]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39096</uri>
			</author>
			<updated>2018-06-13T21:23:50Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=125979#p125979</id>
		</entry>
</feed>
