andy's php projects
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Script and site usage:
All of the scripts on this site are provided free for non-commerical, personal or non-profit use. If you find these scripts useful to you, appreciate the free support, or are just an all round nice person, then why not donate a little dosh? If you wish to use any of these in a commercial system, please refer to the payment plan.


examples

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    php.amnuts.com Forum Index -> Image Functions
View previous topic :: View next topic  
Author Message
mmjaeger
Light Poster


Joined: 22 Oct 2004
Posts: 25

PostPosted: Mon Oct 25, 2004 3:08 am    Post subject: examples Reply with quote

Hello

thanks for the nice class - since I'm a newbie, I was wondering whether anybody could put up some examples how to properly use this class and also how to show the created pictures in the browser.

thanks in advance for your help.
Back to top
View user's profile Send private message
amnuts
Site Admin


Joined: 01 Sep 2002
Posts: 662
Location: East Sussex, England

PostPosted: Tue Nov 02, 2004 5:30 am    Post subject: Reply with quote

To be honest, the first thread should give good enough examples on using the class, and each of the methods has a comment block explaining what it does which should help deciding if you need to use it or not.

Let me break down the examples in the other thread...

I want to load an image up, colourise it to a certain hex colour value, save it as a new file and then output to screen.

PHP:
<?php

    $img 
imagecreatefromjpeg('original.jpg');
    
Image::colourise($img'4c63f2');
    
imagejpeg($img'processed.jpg'90);

    
header('Content-type: image.jpeg');
    
imagejpeg($img''90);

?>


I want to do the same as above, but instead of colourising an image I want to greyscale it.

PHP:
<?php

    $img 
imagecreatefromjpeg('original.jpg');
    
Image::greyscale($img);
    
imagejpeg($img'processed.jpg'90);

    
header('Content-type: image.jpeg');
    
imagejpeg($img''90);

?>


Imagine I have loaded up an image and want to get the hex colour value of the pixel at the x/y coordinates of 15/450:

PHP:
<?php

    
echo Image::rgb2hex(Image::getPixelRGB($img15450)

?>


Example of using hls values on a different thread.

Andy
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    php.amnuts.com Forum Index -> Image Functions All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group