Transparent image

From: AMcD (arnold.mcdonald_at_free.fr)
Date: 11/28/03


Date: Fri, 28 Nov 2003 18:39:49 +0100

Hi!

Here's a piece of code:

[begin]

<?php

Header('Content-type: image/png');

$sz = "";

$FileValue = 1000;

$i = strlen($FileValue);

for ( $j = 0; $j < 7-$i; $j++ )
{
$sz = $sz . "0";
}

$Img = imagecreate(56,13);

$Gold = imagecolorallocate($Img,148,128,100);

$Gray = imagecolorallocate($Img,32,32,32);

ImageFilledRectangle($Img,0,0,55,12,$Gray);

imagestring($Img,4,0,0,$sz.$FileValue,$Gold);

imagepng($Img);

ImageDestroy($Img);
?>

[end]

OK. Calling this script I have a png picture back.

Now I add imagecolortransparent($Img,$Gray); just before imagepng() and OK
again, I have a transparent picture back. But now, if I add:

$r = imagerotate($Img,90,0);

imagepng($r);

just after the imagecolortransparent() instruction seen above, I get a
rotated picture, but not transparent. How to solve that? I've used a plenty
of tricks, no one works.

Thanx.



Relevant Pages

  • Re: A Picture with a ComboBox
    ... Your other points are valid, though, and I must admit I used "no Picture" in a text box to indicate when I hadn't taken a piccie of one of my miniature liqueur bottles. ... should display as if it was in the Imagebox. ... transparent picture is displayed afterwards, ... Private Sub ClearImageBox() ...
    (comp.lang.basic.visual.misc)
  • transparent button on custom commandbar
    ... I'm trying to create a toolbar and having the same trouble everyone ... HOWTO: Create a Transparent Picture For Office CommandBar Buttons ...
    (microsoft.public.excel.programming)
  • Looking for a real working transparent picturebox
    ... hi there, iam still looking for a transparent picture box, that works also ... with 2 pictureboxes over each other or working over an panel. ...
    (microsoft.public.dotnet.languages.vb)
  • back ground
    ... put a picture as my background, frontpage always tiles it ... When I try to add a picture, ... transparent picture. ...
    (microsoft.public.frontpage.programming)
  • Re: stuck copying Images
    ... This is my first vb script from scratch. ... Dim objFile ... 'username and increment employee picture count ...
    (microsoft.public.scripting.vbscript)