Jump to content
Sign in to follow this  
jercfd

PNG Only GUI

Recommended Posts

jercfd

How can I make my GUI to only show PNGs and no default background. I still want it to be able to use regular controls.

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

$hGUI = GUICreate("Show PNG", 240, 240, -1, -1, $WS_POPUP)
GUISetState(@SW_SHOW, $hGUI)

_GDIPlus_StartUp()
$hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\Normal\top-left.png")
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI)
_GDIPlus_GraphicsDrawImage($hGraphic, $hImage, 0, 0)

$hImage2 = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\Normal\top.png")
$hGraphic2 = _GDIPlus_GraphicsCreateFromHWND($hGUI)
_GDIPlus_GraphicsDrawImage($hGraphic2, $hImage2, 18, 0)

$hImage3 = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\Normal\top-right.png")
$hGraphic3 = _GDIPlus_GraphicsCreateFromHWND($hGUI)
_GDIPlus_GraphicsDrawImage($hGraphic2, $hImage3, 240-18, 0)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            _GDIPlus_GraphicsDispose($hGraphic)
            _GDIPlus_ImageDispose($hImage)
            _GDIPlus_GraphicsDispose($hGraphic2)
            _GDIPlus_ImageDispose($hImage2)
            _GDIPlus_GraphicsDispose($hGraphic3)
            _GDIPlus_ImageDispose($hImage3)
            _GDIPlus_ShutDown()
            Exit
    EndSwitch
WEnd

Share this post


Link to post
Share on other sites
Zedna

Try this:

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

$hGUI = GUICreate("Show PNG", 240, 240, -1, -1, $WS_POPUP)
$pic = GUICtrlCreatePic("", 0, 0, 240, 240)
GuiCtrlSetState(-1,$GUI_DISABLE)
$hpic = GUICtrlGetHandle($pic)
GUISetState(@SW_SHOW, $hGUI)

_GDIPlus_StartUp()
$hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\Normal\top-left.png")
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($hpic)
_GDIPlus_GraphicsDrawImage($hGraphic, $hImage, 0, 0)

$hImage2 = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\Normal\top.png")
$hGraphic2 = _GDIPlus_GraphicsCreateFromHWND($hpic)
_GDIPlus_GraphicsDrawImage($hGraphic2, $hImage2, 18, 0)

$hImage3 = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\Normal\top-right.png")
$hGraphic3 = _GDIPlus_GraphicsCreateFromHWND($hpic)
_GDIPlus_GraphicsDrawImage($hGraphic2, $hImage3, 240-18, 0)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            _GDIPlus_GraphicsDispose($hGraphic)
            _GDIPlus_ImageDispose($hImage)
            _GDIPlus_GraphicsDispose($hGraphic2)
            _GDIPlus_ImageDispose($hImage2)
            _GDIPlus_GraphicsDispose($hGraphic3)
            _GDIPlus_ImageDispose($hImage3)
            _GDIPlus_ShutDown()
            Exit
    EndSwitch
WEnd
Edited by Zedna

Share this post


Link to post
Share on other sites
jercfd

That way looks exactly the same as my code. I want the GUI to be invisible but the controls not invisible.

Share this post


Link to post
Share on other sites
BrettF
jercfd

How would I use lod3n launcher to use multiple background images. Also, the top, bottom, and sides need to be dynamically sized from their original. For example, the top.png is 767px long and I want it sized to the current window size.

Share this post


Link to post
Share on other sites
jercfd

BUMP

Share this post


Link to post
Share on other sites
BrettF

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  

×