Jasmine Wiki

Navigation

Wiki Home
Installing Framework
Configuring jasmine.php

Database Module
MySQL
Mysqlix
ODBC
MSSQL

Database Objects
Datagrid
Datasource
Repeater
SQLQuery

Files Module
File
FileSystem
FTP
Attachment
ExcelFile

Graphics Module
Color
Image
Graph


Miscellaneous
Classes:
NumbWordter
Email
Poll
Shield
XMLParser

Functions:
General Functions
HTML Functions
Validation Functions
TrackThisPage

 

Image Class

Image class
This class is useful while creating images with lines. This class is especially used in creating graphs

Configuring jasmine.php
To use image class, uncomment class.Image.php inclusion as well as class.Color.php

Instantiation
The instantiation requires 3 variables to be set before creating.

$img=new Image ($imageWidth, $imageHeight, $imageBgColor);
$img->create();
(or)
$img=new Image;
$img->width=$imageWidth; e.g 700
$img->height=$imageHeight; e.g 300
$img->bgColor=$imageBgColor; e.g. EFEFEF
$img->create();

Publicly accessible methods
1) point($x, $y, [$size, [$color, [$id]]])
It says, put a point on the location specified by $x and $y, with $size and $color. and assign $id to that point
e.g.
$img->point(50, 70, 6, 'Fd0202', 'p1');
$img->point(100, 30, 6, 'Fd0202', 'p2');

2) ellipse($x, $y, $width, $height, $color, [$fillColor])
It says, create an ellipse specified at $x and $y with $width and $height. The curve should be in $color and to fill up the ellipse with $color, $fillColor has to be true.
e.g.
$img->ellipse(200, 200, 40, 75, '733405');
$img->ellipse(200, 200, 40, 75, '733405', true);

3) line($x1, $y1, $x2, $y2, [$color, [$size, [$flip]]])
It says, draw a line from $x1, $y1 to $x2, $y2. Its color should be $color and line size should be $size. If the image is flipped, $flip=true to change the passed coordinates accordingly.
e.g.
$img->line(0,10,$img->width,10,'101010');
$img->line(56,39,$img->width,10,'1F6010',5, true);

4) drawLines($color, $size, [$pointID1, $pointID2, $pointID3.....])
It says using $color and $size, draw lines between $pointIDs specified. $pointIDs can be over loaded.
First and second params are compulsory. Third can be an array of point ids or sequence of points
e.g.
$img->drawLines('a216f4',4, 'p1','p2','p3','p4','p5'); <<< More than 3 params
$img->drawLines('a216f4',4, array('p1','p2','p3','p4','p5')); <<<3rd param is array with all the point IDs.
(c) 2008 Jasmine Framework. A Creation by Krishna Srikanth.