From: Torsten Berg on
Hi,

the following code made me wonder, if this is the desired behaviour:

toplevel .ff

# some small png photo image:
set e $myImage

set d1 [image create photo -data [$e data -format "png -alpha 0.1"]]
ttk::label .ff.l1 -image [list $e disabled $d1]
pack .ff.l1 -padx 10 -pady 10

set d2 [image create photo]
$d2 put [$e data -format "png -alpha 0.1"]]
ttk::label .ff.l2 -image [list $e disabled $d2]
pack .ff.l2 -padx 10 -pady 10

set d3 [image create photo -data [$e data -format "png"]]
$d3 configure -format "png -alpha 0.1"
ttk::label .ff.l3 -image [list $e disabled $d3]
pack .ff.l3 -padx 10 -pady 10

ttk::button .ff.t -text test -command {
.ff.l1 configure -state disabled
.ff.l2 configure -state disabled
.ff.l3 configure -state disabled
}
pack .ff.t -padx 20 -pady 20

The first and second label will not show a transparent photo when
pressing the test button, but the third label will. I thought,
the '-format' option will work on both the 'data' and the 'put'
subcommands. But this code shows, this is not the case. Bug or
feature?


Torsten
From: Donal K. Fellows on
On 28/05/2010 09:08, Torsten Berg wrote:
> The first and second label will not show a transparent photo when
> pressing the test button, but the third label will. I thought,
> the '-format' option will work on both the 'data' and the 'put'
> subcommands. But this code shows, this is not the case. Bug or
> feature?

I'd call it a lack-of-feature. The -alpha option is ignored on writing a
PNG (and will continue to be so until someone supplies the code to make
it work, of course).

Donal.