jercfd Posted January 8, 2009 Share Posted January 8, 2009 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 Link to comment Share on other sites More sharing options...
Zedna Posted January 8, 2009 Share Posted January 8, 2009 (edited) Try this: expandcollapse popup#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 January 8, 2009 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
jercfd Posted January 9, 2009 Author Share Posted January 9, 2009 That way looks exactly the same as my code. I want the GUI to be invisible but the controls not invisible. Link to comment Share on other sites More sharing options...
BrettF Posted January 9, 2009 Share Posted January 9, 2009 Check out this by Lod3n.http://www.autoitscript.com/forum/index.ph...=lod3n+launcherCheers,Brett Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
jercfd Posted January 14, 2009 Author Share Posted January 14, 2009 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. Link to comment Share on other sites More sharing options...
jercfd Posted January 15, 2009 Author Share Posted January 15, 2009 BUMP Link to comment Share on other sites More sharing options...
BrettF Posted January 15, 2009 Share Posted January 15, 2009 It might be possible to create the GDI image, and then draw it the same way. haven't experimented yet though. Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now