DropShadow for WPF Borderless Window

I have written a little utility class that is able to do exactly what you want: drop a standard shadow over a borderless Window but having AllowsTransparency set to false. You just have to call the DropShadowToWindow(Window window) method. It is preferred that you make this call just after the window’s constructor’s InitializeComponent(), but it … Read more

IE6 PNG transparency

I like this Javascript solution writen by David Cilley some time ago. It gets out of the way of compliant browsers and can be used with any back-end you want. It does still require a blank gif image though. Add these functions to your HTML Header or other existing .js include: <script type=”text/javascript”> function fixPngs(){ … Read more

Reasons for why a WinForms label does not want to be transparent?

Add a new class to your project and post the code shown below. Build. Drop the new control from the top of the toolbox onto your form. using System; using System.Windows.Forms; public class TransparentLabel : Label { public TransparentLabel() { this.SetStyle(ControlStyles.Opaque, true); this.SetStyle(ControlStyles.OptimizedDoubleBuffer, false); } protected override CreateParams CreateParams { get { CreateParams parms = … Read more

PNG Transparency with PHP

I have had success doing it like this in the past: $thumb = imagecreatetruecolor($newwidth, $newheight); imagealphablending($thumb, false); imagesavealpha($thumb, true); $source = imagecreatefrompng($fileName); imagealphablending($source, true); imagecopyresampled($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); imagepng($thumb,$newFilename); I found the output image quality much better using imagecopyresampled() than imagecopyresized()

How to export plots from matplotlib with transparent background?

Use the matplotlib savefig function with the keyword argument transparent=True to save the image as a png file. In [30]: x = np.linspace(0,6,31) In [31]: y = np.exp(-0.5*x) * np.sin(x) In [32]: plot(x, y, ‘bo-‘) Out[32]: [<matplotlib.lines.Line2D at 0x3f29750>] In [33]: savefig(‘demo.png’, transparent=True) Result: Of course, that plot doesn’t demonstrate the transparency. Here’s a screenshot … Read more

SVG fill color transparency / alpha?

You use an addtional attribute; fill-opacity: This attribute takes a decimal number between 0.0 and 1.0, inclusive; where 0.0 is completely transparent. For example: <rect … fill=”#044B94″ fill-opacity=”0.4″/> Additionally you have the following: stroke-opacity attribute for the stroke opacity for the entire object

C# Picturebox transparent background doesn’t seem to work

If you want to overlay images over images (and not images over form), this would make the trick: overImage.Parent = backImage; overImage.BackColor = Color.Transparent; overImage.Location = thePointRelativeToTheBackImage; Where overImage and backImage are PictureBox with png (with transparent background). This is because, as said before, the transparency of an image is rendered using the back color … Read more