From 4a880aec9ede6bad619f64b17e6b0282c742a0c8 Mon Sep 17 00:00:00 2001 From: foobar Date: Tue, 12 Jun 2001 01:40:57 +0000 Subject: [PATCH] Added documentation for imagesetstyle() and deprecated buggy function imagedashedline() which is not supported in even GD itself. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@49573 c90b9560-bf6c-de11-be94-00142212c4b1 --- functions/image.xml | 86 +++++++++++++++++++++++++++++++++++---------- 1 file changed, 68 insertions(+), 18 deletions(-) diff --git a/functions/image.xml b/functions/image.xml index d3919b23e5..462b036c5f 100644 --- a/functions/image.xml +++ b/functions/image.xml @@ -1028,9 +1028,7 @@ ImageColorDeAllocate($im, $white); This function was added in PHP 4.0.6 and requires GD 2.0.1 or later - - - + ImageCreate @@ -1363,14 +1361,9 @@ function LoadWBMP ($imgname) { - ImageDashedLine draws a dashed line from - x1, y1 to - x2, y2 (top left is - 0, 0) in image im of color - col. - - - See also ImageLine. + This function is deprecated. Use combination of + ImageSetStyle and ImageLine + instead. @@ -2442,8 +2435,68 @@ ImageDestroy ($im); This function was added in PHP 4.0.6 - - + + + + ImageSetStyle + Set the style for line drawing + + + Description + + + int imagesetstyle + resource im + array style + + + + ImageSetStyle sets the style to be used by all + line drawing functions (such as ImageLine + and ImagePolygon) when drawing with the special + color IMG_COLOR_STYLED or lines of images with color + IMG_COLOR_STYLEDBRUSHED. + + + The style parameter is an array of pixels. + Following example script draws a dashed line from upper left to + lower right corner of the canvas: + + ImageSetStyle + +<?php +Header ("Content-type: image/png"); +$im = imagecreate (100, 100); +$w = ImageColorAllocate ($im, 255, 255, 255); +$red = ImageColorAllocate ($im, 255, 0, 0); + +/* Draw a dashed line, 5 red pixels, 5 white pixels */ +$style=array($red,$red,$red,$red,$red,$w,$w,$w,$w,$w); +ImageSetStyle($im, $style); +ImageLine($im, 0, 0, 100, 100, IMG_COLOR_STYLED); + +/* Draw a line of happy faces using ImageSetBrush() with ImageSetStyle */ +$style=array($w,$w,$w,$w,$w,$w,$w,$w,$w,$w,$w,$w,$red); +ImageSetStyle($im, $style); + +$brush=ImageCreateFromPng("http://www.libpng.org/pub/png/images/smile.happy.png"); +ImageColorTransparent($brush, $w); +ImageSetBrush($im, $brush); +ImageLine($im, 100, 0, 0, 100, IMG_COLOR_STYLEDBRUSHED); + +ImagePng($im); +ImageDestroy ($im); +?> + + + + + See also ImageSetBrush, ImageLine. + + This function was added in PHP 4.0.6 + + + ImageSetTile @@ -2478,9 +2531,7 @@ ImageDestroy ($im); This function was added in PHP 4.0.6 - - - + ImageSetThickness @@ -2503,8 +2554,7 @@ ImageDestroy ($im); This function was added in PHP 4.0.6 and requires GD 2.0.1 or later - - + ImageString