<?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="http://forum.script-coding.com/extern.php?action=feed&amp;tid=5571&amp;type=atom" />
	<updated>2019-03-03T13:14:51Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.script-coding.com/viewtopic.php?id=5571</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: графика]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=132726#p132726" />
			<content type="html"><![CDATA[<p>GDI+ наверное, если DrawImage.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2019-03-03T13:14:51Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=132726#p132726</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: графика]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=132722#p132722" />
			<content type="html"><![CDATA[<p>GDI или GDI+?</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2019-03-03T13:12:07Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=132722#p132722</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: графика]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=132720#p132720" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Malcev пишет:</cite><blockquote><p>С alphablend можно накладывать через GDI.</p></blockquote></div><p>Так я и имел ввиду GDI, на битмап сверху накладываем другой битмап с прозрачностью.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2019-03-03T13:11:30Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=132720#p132720</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: графика]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=132716#p132716" />
			<content type="html"><![CDATA[<p>С alphablend можно накладывать через GDI.<br />По производительности не сравнивал.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2019-03-03T12:57:48Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=132716#p132716</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: графика]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=132713#p132713" />
			<content type="html"><![CDATA[<p>Так а есть смысл, разве простое наложение рисунка с прозрачными областями не так же работает?</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2019-03-03T12:43:35Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=132713#p132713</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: графика]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=132709#p132709" />
			<content type="html"><![CDATA[<p>Кстати, вызов alphablend тут демонстрируется:<br /><a href="https://www.autoitscript.com/forum/topic/86646-how-to-call-alphablend-api-from-autoit/">https://www.autoitscript.com/forum/topi … om-autoit/</a><br />Для запуска надо установить старую версию автоит.<br />Сама библиотека GDI тут:<br /><a href="https://github.com/Kelturio/Misc/tree/master/UDF&#039;s/GDI%20UDFs">https://github.com/Kelturio/Misc/tree/m … GDI%20UDFs</a></p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2019-03-03T12:29:21Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=132709#p132709</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: графика]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=132675#p132675" />
			<content type="html"><![CDATA[<div class="fancy_spoiler_switcher"><div class="fancy_spoiler_switcher_header"><strong>+</strong>&nbsp;Offtop serzh82saratov:</div><div class="fancy_spoiler"><div class="quotebox"><cite>serzh82saratov пишет:</cite><blockquote><p>Очень жирный шрифт, ничего на русском, нет ссылок.</p></blockquote></div><p>Шрифт жирным делает элемент цитирования, документация msdn действительно нерусская, но ссылка на нее оставлена.</p><p>Если же у вас личные обиды за конкретную <a href="http://forum.script-coding.com/viewtopic.php?id=14594">критику</a>, то и выяснять надо было там или в личке.<br />Со своей стороны сплевывать просить не собираюсь, это на ваше усмотрение.</p></div></div>]]></content>
			<author>
				<name><![CDATA[stealzy]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=31937</uri>
			</author>
			<updated>2019-03-02T21:21:51Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=132675#p132675</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: графика]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=132646#p132646" />
			<content type="html"><![CDATA[<p>Спасибо. Вообщем всё не просто.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2019-03-02T17:28:37Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=132646#p132646</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: графика]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=132635#p132635" />
			<content type="html"><![CDATA[<p>Я не вдавался в подробности, но если посмотреть на функцию UpdateLayeredWindow:<br /><a href="https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-updatelayeredwindow">https://docs.microsoft.com/en-us/window … eredwindow</a><br />то там описывается алгоритм наложения:<br /><a href="https://docs.microsoft.com/en-us/windows/desktop/api/wingdi/ns-wingdi-_blendfunction">https://docs.microsoft.com/en-us/window … ndfunction</a><br />Как я понял работает по типу как screen в фотошопе.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2019-03-01T20:35:32Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=132635#p132635</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: графика]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=132633#p132633" />
			<content type="html"><![CDATA[<p>И такое связанное лично с вами, как будто ввязываетесь в чужой разговор, когда никто не просил.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2019-03-01T18:44:27Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=132633#p132633</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: графика]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=132632#p132632" />
			<content type="html"><![CDATA[<p>Очень жирный шрифт, ничего на русском, нет ссылок.<br />Выплюньте ... и расскажите на русском.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2019-03-01T18:39:50Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=132632#p132632</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: графика]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=132631#p132631" />
			<content type="html"><![CDATA[<p>Потому что 0x00000000 это полностью прозрачный черный?<br /></p><div class="quotebox"><cite>https://docs.microsoft.com/en-us/windows/desktop/api/Gdiplusheaders/nf-gdiplusheaders-bitmap-gethbitmap пишет:</cite><blockquote><p>This parameter is ignored if the bitmap is totally opaque.</p></blockquote></div>]]></content>
			<author>
				<name><![CDATA[stealzy]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=31937</uri>
			</author>
			<updated>2019-03-01T17:42:32Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=132631#p132631</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: графика]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=132622#p132622" />
			<content type="html"><![CDATA[<p>В 97 в Gdip_CreateHBITMAPFromBitmap передаётся ARGB. По сути если альфа ноль, то остальное не должно быть важно, но 0x00ffffff так же &quot;забеливает&quot; как и 0xffffffff, почему 0x00000000 не &quot;чернит&quot;?</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2019-03-01T16:16:20Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=132622#p132622</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: графика]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=132606#p132606" />
			<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>2019-03-01T03:37:10Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=132606#p132606</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: графика]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=132605#p132605" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>setbatchlines -1
File = C:\Untitled-1.jpg
a := a_tickcount
loop 1000
{
Gdip_Startup()
pBitmapFile := Gdip_CreateBitmapFromFile(File)

Gdip_GetImageDimensions(pBitmapFile, W, H)   

pBitmap := Gdip_CreateBitmap(W, H)
G := Gdip_GraphicsFromImage(pBitmap)

pBrush := Gdip_BrushCreateSolid(0x88FBD986)
Gdip_FillRoundedRectangle(G, pBrush, 0, 0, W, H, 0) 
Gdip_DeleteBrush(pBrush)
Matrix = 0.5
Gdip_DrawImage(G, pBitmapFile, 0, 0, W, H, 0, 0, W, H, Matrix)

 Gui, -Caption +E0x80000 +HWNDhGui +AlwaysOnTop +ToolWindow
 Gui, Show, Na

 hDCBuf := CreateCompatibleDC()
 hBitmap := Gdip_CreateHBITMAPFromBitmap(pBitmap, 0x00000000)
SelectObject(hDCBuf, hBitmap)

 UpdateLayeredWindow(hGui, hDCBuf, 0, 0, W, H)

Gdip_SaveBitmapToFile(pBitmap, &quot;FinalImage.png&quot;)
}

time := a_tickcount - a
a := a_tickcount

loop 1000
{
Gdip_Startup()
pBitmap := Gdip_CreateBitmapFromFile(File)

Gdip_GetImageDimensions(pBitmap, W, H)   

hBitmap := CreateDIBSection(W, H)
hDC := CreateCompatibleDC()
SelectObject(hDC, hBitmap)
G := Gdip_GraphicsFromHDC(hDC)

pBrush := Gdip_BrushCreateSolid(0x88FBD986)
Gdip_FillRoundedRectangle(G, pBrush, 0, 0, W, H, 0) 
Gdip_DeleteBrush(pBrush)

Matrix = 0.5
Gdip_DrawImage(G, pBitmap, 0, 0, W, H, 0, 0, W, H, Matrix)
Gui, -Caption +E0x80000 +HWNDhGui +AlwaysOnTop +ToolWindow +OwnDialogs +E0x08000000  
Gui, Show, Na

UpdateLayeredWindow(hGui, hDC, 0, 0, W, H)
VarSetCapacity(dib, 104, 0)
DllCall(&quot;GetObject&quot;, Ptr, hBitmap, &quot;int&quot;, A_PtrSize = 8 ? 104 : 84, Ptr, &amp;dib)
Stride := NumGet(dib, 12, &quot;Int&quot;)
Bits := NumGet(dib, 20 + (A_PtrSize = 8 ? 4 : 0))
DllCall(&quot;Gdiplus.dll\GdipCreateBitmapFromScan0&quot;, &quot;uint&quot;, W, &quot;uint&quot;, H, &quot;uint&quot;, Stride, &quot;uint&quot;, 0x26200A, &quot;ptr&quot;, Bits, &quot;ptr*&quot;, pBitmap2)
Gdip_SaveBitmapToFile(pBitmap2, &quot;FinalImage.png&quot;)
}
msgbox % time &quot;`n&quot; a_tickcount - a</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2019-03-01T01:17:24Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=132605#p132605</id>
		</entry>
</feed>
