<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Мигает картинка gui при ее изменении]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=12216</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=12216&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Мигает картинка gui при ее изменении».]]></description>
		<lastBuildDate>Sat, 17 Dec 2016 10:58:59 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Мигает картинка gui при ее изменении]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=109909#p109909</link>
			<description><![CDATA[<p>Если в 13 код добавить:<br /></p><div class="codebox"><pre><code>f11::
Gui,2:  +AlwaysOnTop
Gui,2: Add, Text,, Please enter your name:
Gui,2: Add, Button, Default, OK
Gui,2:  Show
return</code></pre></div><p>То при нажатии f11 новый гуи будет поверх старого.</p>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Sat, 17 Dec 2016 10:58:59 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=109909#p109909</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Мигает картинка gui при ее изменении]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=109891#p109891</link>
			<description><![CDATA[<p><strong>Malcev</strong><br />Худо бедно разобрался , а как насчет слоев?<br />Без gdi+ я сделал несколько окон gui одно на одном .<br />Во всех них было прописано AlwaysOnTop, и друг на друга они налаживались в порядке их вызова. <br />Однако теперь фон который я сделал с gdi+ всегда находиться поверх других gui.</p>]]></description>
			<author><![CDATA[null@example.com (cahtbap1)]]></author>
			<pubDate>Fri, 16 Dec 2016 09:05:16 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=109891#p109891</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Мигает картинка gui при ее изменении]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=109832#p109832</link>
			<description><![CDATA[<div class="quotebox"><blockquote><p>Только вот где я могу прописать координаты картинки?Масштабирование и т.д.</p></blockquote></div><div class="codebox"><pre><code>; Update the specified window we have created (hwnd1) with a handle to our bitmap (hdc), specifying the x,y,w,h we want it positioned on our screen
; So this will position our gui at (0,0) with the Width and Height specified earlier (half of the original image)
UpdateLayeredWindow(hwnd1, hdc, 0, 0, Width//2, Height//2)</code></pre></div><div class="quotebox"><blockquote><p>И еще как мне тут задать те 200 полупрозрачности?</p></blockquote></div><p>Не знаю. Наверное копать матрицу.<br />Либо сразу создавать полупрозрачные png.<br /></p><div class="codebox"><pre><code>; DrawImage will draw the bitmap we took from the file into the graphics of the bitmap we created
; We are wanting to draw the entire image, but at half its size
; Coordinates are therefore taken from (0,0) of the source bitmap and also into the destination bitmap
; The source height and width are specified, and also the destination width and height (half the original)
; Gdip_DrawImage(pGraphics, pBitmap, dx, dy, dw, dh, sx, sy, sw, sh, Matrix)
; d is for destination and s is for source. We will not talk about the matrix yet (this is for changing colours when drawing)
Gdip_DrawImage(G, pBitmap, 0, 0, Width//2, Height//2, 0, 0, Width, Height)</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Tue, 13 Dec 2016 12:54:13 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=109832#p109832</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Мигает картинка gui при ее изменении]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=109830#p109830</link>
			<description><![CDATA[<p><strong>Malcev</strong><br />Все работает , вот такой код получился.<br /></p><div class="codebox"><pre><code>
#SingleInstance, Force
#NoEnv
SetBatchLines, -1
#Include, C:\Program Files\AutoHotkey\lib\Gdip.ahk
If !pToken := Gdip_Startup()
{
	MsgBox, 48, gdiplus error!, Gdiplus failed to start. Please ensure you have gdiplus on your system
	ExitApp
}
OnExit, Exit
Gui, 1: -Caption +E0x80000 +LastFound +AlwaysOnTop +ToolWindow +OwnDialogs
Gui, 1: Show, NA
hwnd1 := WinExist()
SetTimer,circle,100
return

gdi:
If !pBitmap
{
	MsgBox, 48, File loading error!, Could not load the image specified
	ExitApp
}

Width := Gdip_GetImageWidth(pBitmap), Height := Gdip_GetImageHeight(pBitmap)
hbm := CreateDIBSection(Width//2, Height//2)
hdc := CreateCompatibleDC()
obm := SelectObject(hdc, hbm)
G := Gdip_GraphicsFromHDC(hdc)
Gdip_SetInterpolationMode(G, 7)
Gdip_DrawImage(G, pBitmap, 0, 0, Width//2, Height//2, 0, 0, Width, Height)
UpdateLayeredWindow(hwnd1, hdc, 0, 0, Width//2, Height//2)
SelectObject(hdc, obm)
DeleteObject(hbm)
DeleteDC(hdc)
Gdip_DeleteGraphics(G)
Gdip_DisposeImage(pBitmap)
Return

Exit:
Gdip_Shutdown(pToken)
ExitApp
Return

circle:
gosub get
if f=%ff%
	return
if f = 0
    pBitmap := Gdip_CreateBitmapFromFile(&quot;фон0.png&quot;)
if f = 10
    pBitmap := Gdip_CreateBitmapFromFile(&quot;фон1.png&quot;)
if f = 12
    pBitmap := Gdip_CreateBitmapFromFile(&quot;фон2.png&quot;)
if f = 2
    pBitmap := Gdip_CreateBitmapFromFile(&quot;фон3.png&quot;)
if f = 22
    pBitmap := Gdip_CreateBitmapFromFile(&quot;фон4.png&quot;)
if f = 20
    pBitmap := Gdip_CreateBitmapFromFile(&quot;фон5.png&quot;)
if f = 21
    pBitmap := Gdip_CreateBitmapFromFile(&quot;фон6.png&quot;)
if f = 1
    pBitmap := Gdip_CreateBitmapFromFile(&quot;фон7.png&quot;)
if f = 11
    pBitmap := Gdip_CreateBitmapFromFile(&quot;фон8.png&quot;)
goto gdi
return
get:
ff=%f%
f=0
GetKeyState, joyx, JoyX
GetKeyState, joyy, JoyY
if joyx &lt; 47
    EnvAdd,f,1
if joyx &gt; 53
    EnvAdd,f,2
if joyy &lt; 47
    EnvAdd,f,10
if joyy &gt; 53
    EnvAdd,f,20
return</code></pre></div><p>Только вот где я могу прописать координаты картинки?Масштабирование и т.д.<br />И еще как мне тут задать те 200 полупрозрачности?<br /></p><div class="codebox"><pre><code>
WinSet, TransColor, EEAA99 200</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (cahtbap1)]]></author>
			<pubDate>Tue, 13 Dec 2016 10:46:11 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=109830#p109830</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Мигает картинка gui при ее изменении]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=109829#p109829</link>
			<description><![CDATA[<div class="codebox"><pre><code>C:\Program Files\AutoHotkey\lib</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Tue, 13 Dec 2016 10:10:58 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=109829#p109829</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Мигает картинка gui при ее изменении]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=109828#p109828</link>
			<description><![CDATA[<p>А куда можно этот gdip.ahk закинуть чтоб все время его по папкам не таскать , и длинные пути не прописывать?</p>]]></description>
			<author><![CDATA[null@example.com (cahtbap1)]]></author>
			<pubDate>Tue, 13 Dec 2016 10:08:25 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=109828#p109828</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Мигает картинка gui при ее изменении]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=109827#p109827</link>
			<description><![CDATA[<p>Переименовал gdip_all.ahk в gdip.ahk все заработало.Спасибо , буду разбираться :-)</p>]]></description>
			<author><![CDATA[null@example.com (cahtbap1)]]></author>
			<pubDate>Tue, 13 Dec 2016 10:07:07 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=109827#p109827</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Мигает картинка gui при ее изменении]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=109826#p109826</link>
			<description><![CDATA[<p>Попробовал тот скрипт в теме отдельно сохранить как gdip.ahk и убрать ; перед #Include, Gdip.ahk , с виду прогресс двинулся и скрипт остается включенным , но ничего не показывает.</p>]]></description>
			<author><![CDATA[null@example.com (cahtbap1)]]></author>
			<pubDate>Tue, 13 Dec 2016 10:02:33 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=109826#p109826</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Мигает картинка gui при ее изменении]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=109825#p109825</link>
			<description><![CDATA[<p><a href="https://www.dropbox.com/s/0e9gdfetbfa8v0o/Gdip_All.ahk">https://www.dropbox.com/s/0e9gdfetbfa8v0o/Gdip_All.ahk</a></p>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Tue, 13 Dec 2016 09:59:28 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=109825#p109825</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Мигает картинка gui при ее изменении]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=109824#p109824</link>
			<description><![CDATA[<p><strong>Malcev</strong><br />Я не знаю как этим пользоваться , этот скрипт у меня не работает . Может это библиотека какая то&nbsp; и ее устанавливать нужно?Давай лучше по порядку что и как мне делать?</p>]]></description>
			<author><![CDATA[null@example.com (cahtbap1)]]></author>
			<pubDate>Tue, 13 Dec 2016 09:56:40 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=109824#p109824</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Мигает картинка gui при ее изменении]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=109815#p109815</link>
			<description><![CDATA[<p>Только тот, что по ссылке:<br /></p><div class="codebox"><pre><code>; Requires Gdip.ahk either in your Lib folder as standard library or using #Include

#SingleInstance, Force
#NoEnv
SetBatchLines, -1

; Uncomment if Gdip.ahk is not in your standard library
;#Include, Gdip.ahk

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

; Create a layered window (+E0x80000 : must be used for UpdateLayeredWindow to work!) that is always on top (+AlwaysOnTop), has no taskbar entry or caption
Gui, 1: -Caption +E0x80000 +LastFound +AlwaysOnTop +ToolWindow +OwnDialogs

; Show the window
Gui, 1: Show, NA

; Get a handle to this window we have created in order to update it later
hwnd1 := WinExist()

loop
{
   loop 9
   {
      pBitmap := Gdip_CreateBitmapFromFile(&quot;фон&quot; A_Index-1 &quot;.png&quot;)
      GoSub gdi
      sleep 100
   }
}
return


gdi:
; Check to ensure we actually got a bitmap from the file, in case the file was corrupt or some other error occured
If !pBitmap
{
	MsgBox, 48, File loading error!, Could not load the image specified
	ExitApp
}

; Get the width and height of the bitmap we have just created from the file
; This will be the dimensions that the file is
Width := Gdip_GetImageWidth(pBitmap), Height := Gdip_GetImageHeight(pBitmap)

; Create a gdi bitmap with width and height of what we are going to draw into it. This is the entire drawing area for everything
; We are creating this &quot;canvas&quot; at half the size of the actual image
; We are halving it because we want the image to show in a gui on the screen at half its dimensions
hbm := CreateDIBSection(Width//2, Height//2)

; Get a device context compatible with the screen
hdc := CreateCompatibleDC()

; Select the bitmap into the device context
obm := SelectObject(hdc, hbm)

; Get a pointer to the graphics of the bitmap, for use with drawing functions
G := Gdip_GraphicsFromHDC(hdc)

; We do not need SmoothingMode as we did in previous examples for drawing an image
; Instead we must set InterpolationMode. This specifies how a file will be resized (the quality of the resize)
; Interpolation mode has been set to HighQualityBicubic = 7
Gdip_SetInterpolationMode(G, 7)

; DrawImage will draw the bitmap we took from the file into the graphics of the bitmap we created
; We are wanting to draw the entire image, but at half its size
; Coordinates are therefore taken from (0,0) of the source bitmap and also into the destination bitmap
; The source height and width are specified, and also the destination width and height (half the original)
; Gdip_DrawImage(pGraphics, pBitmap, dx, dy, dw, dh, sx, sy, sw, sh, Matrix)
; d is for destination and s is for source. We will not talk about the matrix yet (this is for changing colours when drawing)
Gdip_DrawImage(G, pBitmap, 0, 0, Width//2, Height//2, 0, 0, Width, Height)

; Update the specified window we have created (hwnd1) with a handle to our bitmap (hdc), specifying the x,y,w,h we want it positioned on our screen
; So this will position our gui at (0,0) with the Width and Height specified earlier (half of the original image)
UpdateLayeredWindow(hwnd1, hdc, 0, 0, Width//2, Height//2)


; Select the object back into the hdc
SelectObject(hdc, obm)

; Now the bitmap may be deleted
DeleteObject(hbm)

; Also the device context related to the bitmap may be deleted
DeleteDC(hdc)

; The graphics may now be deleted
Gdip_DeleteGraphics(G)

; The bitmap we made from the image may be deleted
Gdip_DisposeImage(pBitmap)
Return

;#######################################################################

Exit:
; gdi+ may now be shutdown on exiting the program
Gdip_Shutdown(pToken)
ExitApp
Return</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Mon, 12 Dec 2016 18:48:46 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=109815#p109815</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Мигает картинка gui при ее изменении]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=109814#p109814</link>
			<description><![CDATA[<p>Есть какой то гайдик толковый? Я не против научиться чему то новому.<br />Попробовал скрипты по ссылке , с виду не очень понятно , а английские коментарии только запутывают.<br />Копировал все что вижу , запускал в разной последовательности и разными комбинациями , ничего не получилось).</p>]]></description>
			<author><![CDATA[null@example.com (cahtbap1)]]></author>
			<pubDate>Mon, 12 Dec 2016 18:18:50 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=109814#p109814</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Мигает картинка gui при ее изменении]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=109811#p109811</link>
			<description><![CDATA[<div class="quotebox"><cite>Malcev пишет:</cite><blockquote><p>Через GDI+ можно.</p></blockquote></div><p>Что оно такое и как его использовать?</p>]]></description>
			<author><![CDATA[null@example.com (cahtbap1)]]></author>
			<pubDate>Mon, 12 Dec 2016 18:01:38 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=109811#p109811</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Мигает картинка gui при ее изменении]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=109802#p109802</link>
			<description><![CDATA[<p>Через GDI+ можно.<br /><a href="https://autohotkey.com/board/topic/29449-gdi-standard-library-145-by-tic/">https://autohotkey.com/board/topic/2944 … 45-by-tic/</a></p>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Mon, 12 Dec 2016 16:26:39 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=109802#p109802</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Мигает картинка gui при ее изменении]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=109799#p109799</link>
			<description><![CDATA[<p>Поискал на оф. форуме, попробовал разные варианты. От мельканий избавиться не удаётся.</p>]]></description>
			<author><![CDATA[null@example.com (ypppu)]]></author>
			<pubDate>Mon, 12 Dec 2016 14:39:31 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=109799#p109799</guid>
		</item>
	</channel>
</rss>
