Sign in to follow this  
Followers 0
radienergos

SHOW PNG (from autoit3 examples)

3 posts in this topic

#1 ·  Posted (edited)

This example shows a png image inside a gui, but when i minimize the gui (or open another window infront of the gui) the image disappears.

Is there any way to redraw (except adding the graphicdrawimage into the loop) or lock somehow the image ?

PS. The code is from installation of autoit3 (Autoit3\Examples\Gui\Advanced\ShowPNG.au3)

PS 2. I want to redraw the png image not the window

#include <GDIPlus.au3>
#include <GuiConstantsEx.au3>

Opt("MustDeclareVars", 1)
Global $hGUI, $hImage, $hGraphic

$hGUI = GUICreate("Show PNG", 240, 240)
GUISetState()

_GDIPlus_StartUp()
$hImage   = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\Images\Torus.png")

$hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI)
_GDIPlus_GraphicsDrawImage($hGraphic, $hImage, 0, 0)

do
    
until GUIGetMsg() = $GUI_EVENT_CLOSE

; Clean up resources
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_ImageDispose($hImage)
_GDIPlus_ShutDown()
Edited by radienergos

Share this post


Link to post
Share on other sites



radienergos

This example shows

Where example?

Is there any way to redraw

GuiCtrlSetState($hPic, $GUI_DISABLE)

_WinAPI_RedrawWindow

:)

Share this post


Link to post
Share on other sites

I didn't post the code because was from installation of autoit3 (Autoit3\Examples\Gui\Advanced\ShowPNG.au3)

I want to redraw the png image not the window

Thanks

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0