<?php
Header("Content-Type: image/png");
$im = ImageCreate(100 , 100);
// Allocate a background color and a drawing color for the image
$black = ImageColorAlloc ate($im, 0, 0, 0);
$white = ImageColorAlloc ate($im, 255, 255, 255);
/* Now to draw a dashed line from the upper left corner to the
lower right corner */
ImageDashedLine ($im, 0, 0, 99, 99, $white);
// Print and destroy the image
Imagepng($im,"d ashed.png");
ImageDestroy($i m);
?>
no dashed line appear, i created the correct result with the folowing
code
but i does not understand why the imagedashedline does not work.
$style = array ($black,$black, $black,$black,$ black,$white,$w hite,$white,$wh ite,$white);
imagesetstyle ($im, $style);
imageline ($im, 0, 0, 100, 100, IMG_COLOR_STYLE D);
Header("Content-Type: image/png");
$im = ImageCreate(100 , 100);
// Allocate a background color and a drawing color for the image
$black = ImageColorAlloc ate($im, 0, 0, 0);
$white = ImageColorAlloc ate($im, 255, 255, 255);
/* Now to draw a dashed line from the upper left corner to the
lower right corner */
ImageDashedLine ($im, 0, 0, 99, 99, $white);
// Print and destroy the image
Imagepng($im,"d ashed.png");
ImageDestroy($i m);
?>
no dashed line appear, i created the correct result with the folowing
code
but i does not understand why the imagedashedline does not work.
$style = array ($black,$black, $black,$black,$ black,$white,$w hite,$white,$wh ite,$white);
imagesetstyle ($im, $style);
imageline ($im, 0, 0, 100, 100, IMG_COLOR_STYLE D);
Comment