SitePoint Sponsor |
|
User Tag List
Results 1 to 1 of 1
Thread: graphics
-
Jul 12, 2001, 08:40 #1
- Join Date
- Jun 2000
- Posts
- 47
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
graphics
hello
trying to pull in an image from file which has a white background make the white transparent and copy it onto a new image with a black background, the script below below works except for making the background transparent, anyone got any ideas??
thanks in advance
Garrett
$image = ImageCreateFromgif("square.gif"); //the image pulled in from a gif
$white = ImageColorAllocate($image, 255, 255, 255);
ImageColorTransparent($image, $white);
$vir_image = ImageCreate(300,300); //the new virtual image
$black = ImageColorAllocate($vir_image, 0, 0, 0);
ImageCopy ($vir_image, $image, 50, 50, 0, 0, 100, 100);
//Copy a part of vir_image onto image - starting at the position x,y - from x,y on vir_image to x,y.
Bookmarks