Hello out there,
I had this idea: In a rather complicated configuration environment I
would like to somehow 'gray out' sections which are currently not
relevant - as if some sort of fog covers it.
Is there some picture format which supports this 'partial
transparency'?
Hello out there,
I had this idea: In a rather complicated configuration environment I
would like to somehow 'gray out' sections which are currently not
relevant - as if some sort of fog covers it.
Is there some picture format which supports this 'partial
transparency'? or maybe an extension?
I am on Windows with tcl 8.6.10.
Any link or hint or idea will be greatly appreciated.
Helmut
Hi Christian,
Am 07.09.21 um 22:40 schrieb Helmut Giese:thanks, it is so good that there are knowlegeable people around here. However I can't get it to work: Every image command I tried rejects
Hello out there,
I had this idea: In a rather complicated configuration environment I
would like to somehow 'gray out' sections which are currently not
relevant - as if some sort of fog covers it.
Is there some picture format which supports this 'partial
transparency'?
This is called an "Alpha channel" and supported by PNG.
Christian
the option '-alpha'. Do you maybe have an example of its use?
Thank you
Helmut
Am 07.09.21 um 22:40 schrieb Helmut Giese:thanks, it is so good that there are knowlegeable people around here.
Hello out there,
I had this idea: In a rather complicated configuration environment I
would like to somehow 'gray out' sections which are currently not
relevant - as if some sort of fog covers it.
Is there some picture format which supports this 'partial
transparency'?
This is called an "Alpha channel" and supported by PNG.
Christian
Arrgh,
image create photo icon -file "icon.png" ?I didn't have the idea to /quote/ the option and did
image create photo iconDisabled -file "icon.png" \ ?
-format "png -alpha 0.5" ?
image create ... -format png -alpha .05
Thanks a lot Ralf.
However, I have another problem: Since Tk cannot handle an image by
itself it needs a "container" - e.g. a label or a button. Now if I
use a label this label itself has a bottom that is not transparent -
so it seems impossible to achieve what I intended.
Hm, another 'tot geborene Idee' (idea born dead) - nothing new to me
:(
image create photo icon -file "icon.png" ?I didn't have the idea to /quote/ the option and did
image create photo iconDisabled -file "icon.png" \ ?
-format "png -alpha 0.5" ?
If you use the plain Tk label widget, and turn off all the
default configuration options that provide borders/etc., you can get a "container" for the image that is just the image pixels and nothing
more.
On 08/09/2021 19:57, Rich wrote:
If you use the plain Tk label widget, and turn off all theBut it will not be transparent and show the underlying widgets.
default configuration options that provide borders/etc., you can get a
"container" for the image that is just the image pixels and nothing
more.
You can however make a (semi-)transparent toplevel:
toplevel .t -background black
wm attributes .t -alpha 0.5
wm overrideredirect .t 1
But then you'll somehow need to put the toplevel over the desired area,
and update the position whenever the application window is moved,
resized, or (partly) obscured:
wm geometry .t 400x100+10+10
That's going to be a lot of work.
Schelte's suggestion reminds me of the way "tk busy" works. IMHO it is a hack, but when you do "tk busy <window>" then that window is covered
with a fully transparent overlay so that mouse clicks do not reach it anymore. Maybe there is a way to set the "busy window" to an
intermediate transparency?
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 285 |
Nodes: | 16 (2 / 14) |
Uptime: | 29:34:18 |
Calls: | 6,448 |
Files: | 12,050 |
Messages: | 5,254,562 |