Jump to content

GUICtrlCreatePic and GIF transparency


Pieter
 Share

Recommended Posts

I want to display a GIF image (see attachment) that uses transparency. However, the transparent part of the image has been replaced with the color black. I tried to fix this like so (as described in the manual):

$status_icon = GUICtrlCreatePic("img_src\iPodCALsync_aboutico.gif", 8, 8, 65, 64, BitOR($SS_NOTIFY,$WS_GROUP))
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
Unfortunately, this code doesn't fix the problem. Is there anything else I should try?

iPod + Online calendars = iPodCALsync

Link to comment
Share on other sites

I want to display a GIF image (see attachment) that uses transparency. However, the transparent part of the image has been replaced with the color black. I tried to fix this like so (as described in the manual):

$status_icon = GUICtrlCreatePic("img_src\iPodCALsync_aboutico.gif", 8, 8, 65, 64, BitOR($SS_NOTIFY,$WS_GROUP))
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)oÝ÷ ÙIߢ»n«^+(uçhzÉ÷ö×âÆØ^¦ºé²Ø^­æ§ÊØb¥±â,¥vÚòþ«¨µè­Æ¥Á¬¬¶Z½æ¢jez×°¢¹"®*m";¬µ§]­Ç^±ÊâmçbìZ^Úíè^§vØZßÛwºÚ"µÍÚ[ÛYH  ÑÕRPÛÛÝ[Ë]LÉÝÂÌÍÜXÏQÕRPÜX]J  ][ÝÉ][ÝËMMLL    ÌÍÕÔ×ÔÔT ÌÍÕÔ×ÑVÓVQTQ
BÌÍÜÝ]×ÚXÛÛHÕRPÝÜX]TXÊ  ][ÝÝ[Ü[ÚY][ÝËMM]Ô    ÌÍÔÔ×ÓÕQK    ÌÍÕÔ×ÑÔÕT
JBÕRPÝÙ]ÐÛÛÜLK   ÌÍÑÕRWÐÐÓÓÔÕSÔTS
BÕRTÙ]Ý]J
BÂ ÌÍÛÙÈHÕRQÙ]ÙÊ
B[[ ÌÍÛÙÈH ÌÍÑÕRWÑUSÐÓÔÑB^]
Link to comment
Share on other sites

This doesn't do what I thought it would do. I need the transparent part to have the color of the GUI. Is there a way to fetch the GUI background color string? (I don't want the window to look ugly if people don't use the default XP theme.)

Edited by Pieter

iPod + Online calendars = iPodCALsync

Link to comment
Share on other sites

it is always good to have a complete working script.

I just add what is described in example 2 of the help and tha's fine;)

#include <GUIConstants.au3>

$pic=GUICreate("", 96, 96, 100, 100,$WS_POPUP,$WS_EX_LAYERED)

$status_icon = GUICtrlCreatePic("transparent.gif", 0, 0, 96, 96, BitOR($SS_NOTIFY,$WS_GROUP))
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUISetState()

do
    $msg = GUIGetMsg()
until $msg = $GUI_EVENT_CLOSE
Exit
Why does having the form set to $WS_POPUP make the gif background transparency work? The background should be transparent even if it's not $WS_POPUP, but as Pieter says, it's black.

Also, if the gif background is transparent why does that also make the form transparent in that area?

I think this behaviour is wrong.

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

Right now, this is what it looks like:

Posted Image

With 'transparent', I mean something like this (manipulated screenshot):

Posted Image

How can I accomplish this?

You can do it like by having another form behind which is not set as $WS_POPUP

#include <GUIConstants.au3>
$p0c=GUICreate("", 190, 160, 100, 100)
GUISetState()
$pic=GUICreate("dsfvsds", 196, 196, 100, 100,$WS_POPUP,$WS_EX_LAYERED);,$WS_POPUP,$WS_EX_LAYERED)

$status_icon = GUICtrlCreatePic("transparent.gif", 10, 10, 96, 96, BitOR($SS_NOTIFY,$WS_GROUP))
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUISetState()

do
    $msg = GUIGetMsg()
until $msg = $GUI_EVENT_CLOSE
Exit

But as I said in my last post, I think the behaviour is wrong and you shouldn't need to do things like this.

Edited by martin
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

You can do it like by having another form behind which is not set as $WS_POPUP

#include <GUIConstants.au3>
$p0c=GUICreate("", 190, 160, 100, 100)
GUISetState()
$pic=GUICreate("dsfvsds", 196, 196, 100, 100,$WS_POPUP,$WS_EX_LAYERED);,$WS_POPUP,$WS_EX_LAYERED)

$status_icon = GUICtrlCreatePic("transparent.gif", 10, 10, 96, 96, BitOR($SS_NOTIFY,$WS_GROUP))
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUISetState()

do
    $msg = GUIGetMsg()
until $msg = $GUI_EVENT_CLOSE
Exit

But as I said in my last post, I think the behaviour is wrong and you shouldn't need to do things like this.

You need to define the background so the multiple windows as described in the example2 with do it.
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...