Htaccess    html   Php    javascript   Asp   css    maths  Past Questions  Practice Tests Online

imagesetstyle function syntax tag tutorial 2013





Alert! Connect with 10,000 Chating Online. Join Now

Php imagesetstyle () function

Write your php code

 
<?php ?>

Php Result


Your code below



(PHP 4 >= 4.0.6, PHP 5)

imagesetstyle -- Set the style for line drawing

Syntax

bool imagesetstyle ( resource image, 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. Returns TRUE on success or FALSE on failure.

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:

Example 1. imagesetstyle() example

<?php
header
("Content-type: image/jpeg");
$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");
$w2 = imagecolorallocate($brush, 255, 255, 255);
imagecolortransparent($brush, $w2);
imagesetbrush($im, $brush);
imageline($im, 100, 0, 0, 100, IMG_COLOR_STYLEDBRUSHED);

imagejpeg($im);
imagedestroy($im);
?>

See also imagesetbrush(), imageline().

Note: This function was added in PHP 4.0.6

Php imagesetstyle Function syntax tag

imagesetstyle php code on this is provided for your study purpose, it will guide you to know how create and design a website using php. use it to practice and train your self online



Php imagesetstyle syntax tutorial

php tutorial guide and code design are for easy learning and programming. The code practice section provided at the top is for practising of this syntax. Use the code section up to practice your php programming online. Learning php is very easy, all you need is to use the examples on this site and practice them to perfect your skills.


Function index

Variables

Expressions

Operators

Control-Structures

Cookies

Array

Date & Time

Directory function

File

Image

Operators

Form data handling

Mathematics operators

Mail

Php Mysql

Network Functions

Strings

php tutorial guides,functions, classes, code examples and tags for creating simple dynamic site to mysql database driven sites
 
 
Htaccess    html   Php    javascript   Asp   css    maths  Past Questions  Practice Tests Online