transparency

Swing transparent background not being repainted

落花浮王杯 提交于 2020-07-22 21:36:24
问题 I have a problem using transparent backgrounds in Swing. There are a lot of artefacts produced as swing is not repainting changed regions. As far as I can tell there are 2 out-of-the-box ways to use transparent backgrounds: an opaque component with transparent color set as background (left txt field) Problem : the transparent part of the background is never refreshed -> Artefacts. an non-opaque component with transparent color set as background (right txt field) Problem : background is not

Convert non-transparent image to transparent gif image PIL

大兔子大兔子 提交于 2020-06-27 18:38:09
问题 Is it possible to convert a non-transparent png file into a transparent gif file with PIL? I need it for my turtle-graphics game. I can only seem to transparentize a png file, not a gif file. Thanks! 回答1: It's not obvious, to me at least, how you are supposed to do that! This may be an unnecessary work-around for a problem that doesn't exist because I don't know something about how PIL works internally. Anyway, I messed around with it long enough using this input image: #!/usr/bin/env python3

How to add transparency to a value from a HTML input type color field in CSS?

风格不统一 提交于 2020-06-27 09:01:17
问题 In my CSS I need an color based on user picked color. The color picked is used with a fixed transparency of 80%. The following form element will let the user choose a color easily. <input type=color value=#00ffff> // #00ffff But how can I add transparency to it in CSS? rgba(#00ffff,.8) // doesn't work Update : I specifically asked how to do it in CSS, not in JS. BTW it's for a PHP driven CMS. I don't wanna force JS on users, and I prefer not to write conversion functions in PHP. Probably I

How to convert rgba to a transparency-adjusted-hex?

本秂侑毒 提交于 2020-06-24 00:10:09
问题 I'm wondering how to convert rgba into hex in a way that translates the visible rgba-color (including transparency) into a hex value. Say I have this: rgba(0,129,255,.4) Which is sort of a "light blue"... I would like to know if there is a way to get the same light blue "visible" color in hex, so I don't want the converted #0081ff but something close to the color visible on screen. Question: How to convert rgba to a transparency-adjusted-hex? 回答1: It depends on the background to which your

How to convert rgba to a transparency-adjusted-hex?

天大地大妈咪最大 提交于 2020-06-24 00:09:09
问题 I'm wondering how to convert rgba into hex in a way that translates the visible rgba-color (including transparency) into a hex value. Say I have this: rgba(0,129,255,.4) Which is sort of a "light blue"... I would like to know if there is a way to get the same light blue "visible" color in hex, so I don't want the converted #0081ff but something close to the color visible on screen. Question: How to convert rgba to a transparency-adjusted-hex? 回答1: It depends on the background to which your

Help with Tkinter Alpha

时光毁灭记忆、已成空白 提交于 2020-06-18 12:57:37
问题 I have a python program that has no windows frame and doesn't show up in the taskbar because of self.overrideredirect(1) . This program has an options menu (a top level widget) that allows for the alpha to be adjusted with self.attributes("-alpha", 0.85) . However when I close out of the options menu my program shows up in the task bar. Obviously I don't want it to do this. I tried invoking the self.overrideredirect(1) command after the options menu was closed, but to no avail. Does anyone

Gnuplot: transparency of data points when using palette

夙愿已清 提交于 2020-05-23 09:33:10
问题 Is there a way to plot transparent data points when using palette? I currently have the following code: set style fill transparent solid 0.2 noborder set palette rgb 22,13,-22 plot 'mydata.dat' u 1:2:3 ps 0.3 palette My feeling is that transparency is overwritten by the arguments of the plot command. 回答1: Is there a way to plot transparent data points when using palette? If you check help palette you will not find (or I overlooked) a statement about transparency in the palette. It looks like

PHP imagick or any other tool, how to detect if there is visible transparency on gifs files

戏子无情 提交于 2020-05-13 14:37:05
问题 I am working on a service that can do conversions from gif to mp4 files (with ffmpeg ). My problem is some of the gifs have visible transparent areas which end up as white color when I convert them to mp4 video. To avoid that problem I am trying detect if a gif has visible transparent areas so I will avoid converting them to mp4. I tried to use getImageAlphaChannel() function from imagick. if ($imagick->getImageAlphaChannel()) { echo 'transparent image'; } else { echo 'not transparent image';

WPF: How to avoid an image get out of Canvas's borders?

早过忘川 提交于 2020-05-12 21:21:46
问题 I have a canvas as an image viewer. Its background is used to place an image and I'd like to put another image on top of it. So, the scenario is like this: <Canvas Name="VisorCanvas" Height="514" Width="720"> <Canvas.Background> <ImageBrush /> </Canvas.Background> <Image Name="foreground" /> </Canvas> I insert images dynamically in code behind (C#). The problem is that if the image is too big, then the image goes beyond the Canvas's borders. For instance: I have an irrelevant background image

WPF: How to avoid an image get out of Canvas's borders?

可紊 提交于 2020-05-12 21:04:52
问题 I have a canvas as an image viewer. Its background is used to place an image and I'd like to put another image on top of it. So, the scenario is like this: <Canvas Name="VisorCanvas" Height="514" Width="720"> <Canvas.Background> <ImageBrush /> </Canvas.Background> <Image Name="foreground" /> </Canvas> I insert images dynamically in code behind (C#). The problem is that if the image is too big, then the image goes beyond the Canvas's borders. For instance: I have an irrelevant background image