Source for file example_03.php

Documentation is available at example_03.php

  1. <?php
  2. /**
  3. * Convert Example #03
  4. *
  5. * This example shows how to grayscale an image. We are using the `gd_hack`
  6. * driver since the "greyscalling" is not supported by the regular `gd` driver.
  7. *
  8. * @filesource
  9. * @package Asido.Examples
  10. * @subpackage Asido.Examples.Convert
  11. */
  12.  
  13. /////////////////////////////////////////////////////////////////////////////
  14.  
  15. /**
  16. * Include the main Asido class
  17. */
  18. include('./../../class.asido.php');
  19.  
  20. /**
  21. * Set the correct driver: this depends on your local environment
  22. */
  23. asido::driver('gd_hack');
  24.  
  25. /**
  26. * Create an Asido_Image object and provide the name of the source
  27. * image, and the name with which you want to save the file
  28. */
  29. $i1 = asido::image('example.png', 'result_03.png');
  30.  
  31. /**
  32. * Do grayscale it ;)
  33. */
  34. Asido::GreyScale($i1);
  35.  
  36. /**
  37. * Save the result
  38. */
  39. $i1->save(ASIDO_OVERWRITE_ENABLED);
  40.  
  41. /////////////////////////////////////////////////////////////////////////////
  42.  
  43. ?>

Documentation generated on Mon, 09 Apr 2007 23:57:10 +0300 by phpDocumentor 1.3.0RC4