<?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=17853&amp;type=atom" />
	<updated>2023-07-03T14:47:16Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=17853</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Наложение картинки]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=158650#p158650" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>serzh82saratov пишет:</cite><blockquote><p>А вопрос ты как задал?</p></blockquote></div><p>Попросил рассказать, как работает матрица в функции GdipSetImageAttributesColorMatrix, а потом рассказать подробнее о каждом значении.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2023-07-03T14:47:16Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=158650#p158650</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Наложение картинки]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=158649#p158649" />
			<content type="html"><![CDATA[<p>В gdi+ нету, в direct2d есть.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2023-07-03T12:56:56Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=158649#p158649</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Наложение картинки]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=158648#p158648" />
			<content type="html"><![CDATA[<p>Да, вспомнил про что ты, когда то тестил.<br />А почему ты про Мкод говоришь, на Gdip без перебора пикселей думаешь нет вариантов?</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2023-07-03T12:22:11Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=158648#p158648</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Наложение картинки]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=158647#p158647" />
			<content type="html"><![CDATA[<p>Тут ассемблер не нужен.<br />Достаточно базовых знаний c++.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2023-07-03T11:07:18Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=158647#p158647</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Наложение картинки]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=158646#p158646" />
			<content type="html"><![CDATA[<p>Без ассембелера не полетит, а с ним не для простых смертных, ты пишешь на нём?</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2023-07-03T11:04:33Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=158646#p158646</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Наложение картинки]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=158645#p158645" />
			<content type="html"><![CDATA[<p>Делаешь lockbits на оба pbitmap, получаешь значения каждого пиксела и по формуле высчитываешь их объединенное значение.<br />Для скорости можно через машинный код запилить.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2023-07-03T10:20:02Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=158645#p158645</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Наложение картинки]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=158644#p158644" />
			<content type="html"><![CDATA[<p>Это когда то читал, надо вспомнить расширенную библиотеку, там вроде это было, кажется там даже два pGraphics как то использовались.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2023-07-03T08:13:53Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=158644#p158644</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Наложение картинки]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=158643#p158643" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>serzh82saratov пишет:</cite><blockquote><p>Интересно, Matrix, это и есть режим смешивания.</p></blockquote></div><p>Нет, если интересуют режимы смешивания, то можешь здесь посмотреть алгоритмы:<br /><a href="https://www.codeproject.com/Articles/5527/Blending-of-images-raster-operations-and-basic-col">https://www.codeproject.com/Articles/55 … -basic-col</a></p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2023-07-03T06:59:28Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=158643#p158643</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Наложение картинки]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=158642#p158642" />
			<content type="html"><![CDATA[<p>А вопрос ты как задал?</p><br /><br /><p>Интересно, Matrix, это и есть режим смешивания.<br /><span class="postimg"><img src="https://i.imgur.com/7sQc2Dk.png" alt="https://i.imgur.com/7sQc2Dk.png" /></span></p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2023-07-03T06:10:50Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=158642#p158642</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Наложение картинки]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=158641#p158641" />
			<content type="html"><![CDATA[<p>Я сам до сегодняшнего дня не знал, но мне ChatGPT довольно подробно пояснил. <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /> 0.5 отвечает за альфа-канал.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2023-07-03T04:54:41Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=158641#p158641</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Наложение картинки]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=158640#p158640" />
			<content type="html"><![CDATA[<p>Знать бы ещё что это за зверь, и как им играться.<br />У тебя оно как MatrixNegative, только одна из единиц заменена на 0.5. Но что это за магический набор 25 значений...</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2023-07-03T04:29:30Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=158640#p158640</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Наложение картинки]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=158639#p158639" />
			<content type="html"><![CDATA[<p>Как-то с матрицей поиграть?<br /></p><div class="codebox"><pre><code>Matrix = -1|0|0|0|0|0|-1|0|0|0|0|0|-1|0|0|0|0|0|0.5|0|0|0|0|0|1
Gdip_DrawImage(pGraphics, pBitmapSource2, 0, 0, sWidth, sHeight, 0, 0, sWidth, sHeight, Matrix)</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2023-07-02T23:08:56Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=158639#p158639</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Наложение картинки]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=158638#p158638" />
			<content type="html"><![CDATA[<p>Забыл или не знал функцию, если кодом на 1.jpg наложить 2.png, то получается 0.jpg.<br />В итоге линии из 2.png получаются размытыми.<br />Если например тоже самое сделать в PaintDotNet слоями, в режиме смешивания &quot;умножение&quot;, то получается как надо, результат на 3.jpg.</p><p>Картинки в архиве.</p><div class="codebox"><pre><code>
#SingleInstance, Force
#NoEnv


sFile1 = D:\Temp\1.jpg
sFile2 = D:\Temp\2.png   
oFile = D:\Temp\0.jpg   

If !pToken := Gdip_Startup()
{
	MsgBox, 48, gdiplus error!, Gdiplus failed to start. Please ensure you have gdiplus on your system
	ExitApp
} 

pBitmapSource2 := Gdip_CreateBitmapFromFile(sFile2)
pBitmapSource1 := Gdip_CreateBitmapFromFile(sFile1) 
sWidth := Gdip_GetImageWidth(pBitmapSource1), sHeight := Gdip_GetImageHeight(pBitmapSource1) 

pGraphics := Gdip_GraphicsFromImage(pBitmapSource1) 
; Gdip_SetSmoothingMode(pGraphics, 4)
; Gdip_SetInterpolationMode(pGraphics, 7) 
; Gdip_SetCompositingMode(pGraphics, 1) 
Gdip_DrawImage(pGraphics, pBitmapSource2, 0, 0, sWidth, sHeight, 0, 0, sWidth, sHeight)

Gdip_SaveBitmapToFile(pBitmapSource1, oFile)
Gdip_DeleteGraphics(pGraphics)
Gdip_DisposeImage(pBitmapSource2) 
Gdip_DisposeImage(pBitmapSource1)  
Gdip_Shutdown(pToken) 
	
run &quot;%oFile%&quot;   
exitapp
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2023-07-02T19:57:45Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=158638#p158638</id>
		</entry>
</feed>
