Contents
Login Register Wishes Forum About
Language Reference » Drawing functions » drawFromJPG
Help topics
Latest updates
2208d  replaceImageMapTitle
2208d  replaceImageMapValues
2208d  createFunctionSerie
2208d  setAbsicssaPosition
2208d  negateValues
Toolbox
  Download as PDF
  Print this page
  Share this page
  Create an account
  Feed the updates!
Google AdSense
drawFromJPG - Add pictures to your charts

This function allows you to add JPG pictures to your charts. If you turn on shadow support before calling this function, the merged picture will be drawn with the specified shadow parameters.

Calling this function
drawFromJPG($X,$Y,$FileName);
Where :

X,Y are the coordinate where will be drawn the top left corner of the picture.
FileName is the path to the picture file.

It is recommended to use PNG files when you want to include pictures into your charts. This is the only real portable format that can handle alpha channels, thus the pictures will look crystal clear.


Sample script



 /* Turn off shadow */
 $myPicture->setShadow(FALSE);
 $myPicture->drawFromJPG(100,45,"resources/landscape1.jpg");

 /* Enable shadow */
 $myPicture->setShadow(TRUE,array("X"=>2,"Y"=>2,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>20)); 
 $myPicture->drawFromJPG(380,45,"resources/landscape2.jpg");

This will draw two pictures, the first one without shadow and the second one with the internal pChart shadow algorithm.
Last updated on 10/15/2009 
by Jean-Damien 
Linked resources
Community comments
  No comments have been posted yet.
© Copyrights
Components used on this web site : Famfamfam icons has been made by Mark James, Rounded corners lite has been coded by Cameron Cooke and Tim Hutchison, SyntaxHighlighter has been written by Alex Gorbatchev. pChart and this web site have been created by Jean-Damien POGOLOTTI. This documentation contains 185 pages and 56 comments. 409 users have registered. This page has been rendered in 0,01 seconds. Wiki revision 1.37.