18.12 Making an Image Interlaced


You want to make an image interlaced, meaning that it will load in multiple scans .

Technique

Use the ImageInterlace() function on an image stream:

 <?php header("Content-type: image/gif"); $im = ImageCreate(100, 20); ImageInterlace($im, 1); $white = ImageColorAllocate($im, 255, 255, 255); ImageColorTransparent($im, $white); $light_red = ImageColorAllocate($im, 233, 93, 20); ImageArc($im, 4, 5, 50, 40, 10, 180, $light_red); ImageGif($im); ImageDestroy($im); ?> 

Comments

The ImageInterlace() function enables you to set whether an image stream is interlaced. If the second argument of ImageInterlace() is true ( 1 ), the image is interlaced; otherwise , the image is not interlaced. By default, images are not interlaced.

If the second argument is not provided to the ImageInterlace() function, the function simply returns whether the image is currently interlaced.



PHP Developer's Cookbook
PHP Developers Cookbook (2nd Edition)
ISBN: 0672323257
EAN: 2147483647
Year: 2000
Pages: 351

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net