PHP/GD – transparent background

imagecolortransparent is probably not what you want here if you’re merging images, as single-colour transparency is nasty. Instead, try it with a transparent fill mask like so: <?php $image = imagecreatetruecolor(100, 100); // Transparent Background imagealphablending($image, false); $transparency = imagecolorallocatealpha($image, 0, 0, 0, 127); imagefill($image, 0, 0, $transparency); imagesavealpha($image, true); // Drawing over $black = … Read more

How can I add transparency to a c# form while keeping controls visible?

This is pretty easy to do in Winforms. What you need is a sandwich of two forms. The bottom one should provide the transparent gradient background, the top one should draw the icons and handle mouse clicks. Some sample code: public partial class Form1 : Form { public Form1() { InitializeComponent(); this.TopMost = true; this.FormBorderStyle … Read more

JavaFX 3D Transparency

Since JDK8u60 b14 transparency is enabled in 3D shapes. This is a quick test done with it: A cylinder with diffuse color Color.web(“#ffff0080”), is added on top of a box and two spheres. group.getChildren().addAll(sphere1, sphere2, box, cylinder); There’s no depth sort algorithm though, meaning that order of how 3D shapes are added to the scene … Read more

How to CREATE a transparent gif (or png) with PIL (python-imaging)

The following script creates a transparent GIF with a red circle drawn in the middle: from PIL import Image, ImageDraw img = Image.new(‘RGBA’, (100, 100), (255, 0, 0, 0)) draw = ImageDraw.Draw(img) draw.ellipse((25, 25, 75, 75), fill=(255, 0, 0)) img.save(‘test.gif’, ‘GIF’, transparency=0) and for PNG format: img.save(‘test.png’, ‘PNG’)

Progressbar with Percentage Label?

This is possible using a ttk.Style. The idea is to modify the layout of the Horizontal.TProgressbar style (do the same with Vertical.TProgressbar for a vertical progressbar) to add a label inside the bar: Usual Horizontal.TProgressbar layout: [(‘Horizontal.Progressbar.trough’, {‘children’: [(‘Horizontal.Progressbar.pbar’, {‘side’: ‘left’, ‘sticky’: ‘ns’})], ‘sticky’: ‘nswe’})] With an additional label: [(‘Horizontal.Progressbar.trough’, {‘children’: [(‘Horizontal.Progressbar.pbar’, {‘side’: ‘left’, ‘sticky’: … Read more