Jump to content

Gui only with CloseBox, not Resizable, with Gif without Transparency


Raik
 Share

Recommended Posts

GUICreate("Title", 300, 300,-1,-1,$WS_SYSMENU)
$image = GUICtrlCreatePic("1.gif", 175, 20, 30, 30)
....
GUICtrlSetImage($image,"2.gif")
....
GUICtrlSetImage($image,"3.gif")

i want a nonresizable gui with only a closebox and a pic, to show statuschange.

i have removed the alpha-chanel from the gifs, saved them as bitmaps, but nothing helps.

even with bitmaps instead of gifs i get transparent areas inside the pic and the new image does not replace the before but will be drawn (partialy transparent ;) ) on top of it, so parts of the before image will stay visible.

how may i remove this behavior (the transparency)?

help states:

GUICtrlCreatePic

To have a transparent picture it is needed to create the GUI window with WS_EX_LAYERED extended style.

but i have not set extended style. ;):)

AutoIt-Syntaxsheme for Proton & Phase5 * Firefox Addons by me (resizable Textarea 0.1d) (docked JS-Console 0.1.1)

Link to comment
Share on other sites

GUICreate("Title", 300, 300,-1,-1,$WS_SYSMENU)
$image = GUICtrlCreatePic("1.gif", 175, 20, 30, 30)
....
GUICtrlSetImage($image,"2.gif")
....
GUICtrlSetImage($image,"3.gif")

i want a nonresizable gui with only a closebox and a pic, to show statuschange.

i have removed the alpha-chanel from the gifs, saved them as bitmaps, but nothing helps.

even with bitmaps instead of gifs i get transparent areas inside the pic and the new image does not replace the before but will be drawn (partialy transparent ;) ) on top of it, so parts of the before image will stay visible.

how may i remove this behavior (the transparency)?

help states:

but i have not set extended style. ;):)

Could you post some small example code which we can run and which lets us see the problem, with a sample image?
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

  • 1 month later...

Opt("GUIOnEventMode",1)
Gui()
Func Gui()
    Local $msg
    GUICreate("", 300, 300)
    GUISetOnEvent(-3, "End")
        Global $status_image = GUICtrlCreatePic("noShock.bmp", 10, 10, 32, 32)
        GUICtrlCreatePic("noShock.bmp", 10, 45, 32, 32)
        GUICtrlCreatePic("stopped.bmp", 10, 80, 32, 32)
    GUISetState(@SW_SHOW)
EndFunc

While 1
    Sleep(1000)
    GUICtrlSetImage($status_image,"stopped.bmp")
    Sleep(1000)
    GUICtrlSetImage($status_image,"noShock.bmp")
WEnd

Func End()
    GUIDelete()
    Exit
EndFunc

stopped.bmp

noShock.bmp

AutoIt-Syntaxsheme for Proton & Phase5 * Firefox Addons by me (resizable Textarea 0.1d) (docked JS-Console 0.1.1)

Link to comment
Share on other sites

You can clear the picture quickly just before you change it!

While 1
    GUICtrlSetImage($status_image, "stopped.bmp")
    Sleep(1000)
    GUICtrlSetImage($status_image, "")
    GUICtrlSetImage($status_image, "noShock.bmp")
    Sleep(1000)
    GUICtrlSetImage($status_image, "")
WEnd

If you do not want to change the current picture create a label under it with it's own colour:

$Stat_Label = GUICtrlCreateLabel("    ",10, 10,32,32)
    GUICtrlSetBKColor($Stat_Label, 0xFF0001)
Edited by JoHanatCent
Link to comment
Share on other sites

as a workaround, ok

but still the question is, why is this behavior without the necessary extended style parameters ($WS_EX_LAYERED)? and why transparency with bitmaps??? :graduated:

is it my fail or a bug in autoit?

btw. i have found another way: i use icons. but the question remains.

Edit: typos

Edited by Raik

AutoIt-Syntaxsheme for Proton & Phase5 * Firefox Addons by me (resizable Textarea 0.1d) (docked JS-Console 0.1.1)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...