SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict Garrett's Avatar
    Join Date
    Feb 2001
    Location
    England
    Posts
    352
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    image creation functions

    Hello

    Does anyone know of a way to stop an image being created with php having the first colour as its background, for example i want to create an image with an alpha in it, i use....

    $alpha = ImageCreateFromgif("alpha.gif");
    ImageCopy ($img, $alpha, 0, 0, 0, 0, 120, 120);

    to copy and paste in an image which already has an alpha and my php image has an alpha, now i need to draw onto the image but when i set the colour to draw for example...

    $white = ImageColorAllocate($img, 255, 255, 255);

    it of course sets the background to white by default!

    an ideas anyone???

    a+
    Garrett

  2. #2
    SitePoint Addict Garrett's Avatar
    Join Date
    Feb 2001
    Location
    England
    Posts
    352
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok someone solved my problem elsewhere, all i need to do is set the white to transparent like so...

    >$white = ImageColorAllocate($image, 255, 255, 255);
    >$trans = ImageColorTransparent($image, $white);

    a+
    Garrett


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •