Jump to content
Sign in to follow this  
Unc3nZureD

Transparent GUI & PNG Controls

Recommended Posts

Unc3nZureD

I'd like to build my software of pictures. I've already made some PNGs with transparency, howevery I don't need the GUI background. So, let me show you where I'm at currently :)

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
#include <WinAPI.au3>
#include "GUICtrlPic.au3"

Dim $GO = False
AdlibRegister("_Play", 100)

$Form1 = GUICreate("Updater Test", 899, 590)
$a0 = _GUICtrlPic_Create(@ScriptDir & "\uresbar.png", 64, 438, 769, 60)
$a1 = _GUICtrlPic_Create(@ScriptDir & "\uresbar.png", 64, 501, 769, 60)
$a2 = _GUICtrlPic_Create(@ScriptDir & "\telibar.png", 64, 438, 769, 60)
$a3 = _GUICtrlPic_Create(@ScriptDir & "\telibar.png", 64, 501, 769, 60)
$a4 = _GUICtrlPic_Create(@ScriptDir & "\háttér.png", 0, 0, 899, 590)
$a5 = _GUICtrlPic_Create(@ScriptDir & "\buttpassive.png", 329, 381, 241, 50)
GUISetState(@SW_SHOW)

For $i = 0 to 100
    _GuiCtrlSetProgress($a2, $i)
Next

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $a5
            MsgBox(0,"", "START")
    EndSwitch
WEnd

Func _Play()
    $ReadMouse = GUIGetCursorInfo()
    If IsArray($ReadMouse) = 1 Then
        Select
            Case $ReadMouse[4] = $a5 And $GO = False
                _GUICtrlPic_SetImage($a5, @ScriptDir & "\buttactive.png", 0)
                $GO = True
            Case $ReadMouse[4] <> $a5 And $GO = True
                _GUICtrlPic_SetImage($a5, @ScriptDir & "\buttpassive.png", 0)
                $GO = False
        EndSelect
    EndIf
EndFunc

Func _GuiCtrlSetProgress($idPic, $data)
    $aBitmap = _GUICtrlPic_LoadImage(@ScriptDir & "\telibar.png")
    $hBitmap = $aBitmap[0]

    $hBitmap = _GUICtrlPic_ScaleBitmap($hBitmap, 769 * $data / 100, 60, $aBitmap[1], $aBitmap[2])
    GUICtrlSendMsg($idPic, 0x0172, 0x0000, $hBitmap)
    GUICtrlSetState($idPic, $GUI_SHOW)

    Return True
EndFunc

This one works well, I just would like to remove the background of my main "GUICreate". Is it possible anyways?

Here's a pic what annoys me if it's still not clear :)

post-57268-0-11294700-1377698963_thumb.p

Share this post


Link to post
Share on other sites
BrewManNH

$WS_POPUP style of any use?


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites
Danyfirex
UEZ

$WS_POPUP + $WS_EX_LAYERED + _WinAPI_UpdateLayeredWindow

Br,

UEZ


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

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  

×