Source for file example_05.php

Documentation is available at example_05.php

  1. <?php
  2. /**
  3. * Resize Example #05
  4. *
  5. * This example shows the `passepartout` resize which resizes the image
  6. * proportionally, but the result has the proportions of the provided width and
  7. * height with the blank areas filled with the provided color. In the case we are
  8. * resizing a 640x480 image by making it fit inside a square frame 300x300 and
  9. * using a nice green color as background. If the color argument is omitted, then
  10. * "white" is used to fill the blank areas. This is very handy when you want all
  11. * the resulting images to fit inside some frame without stretching them if the
  12. * proportions of the image and the frame do not match
  13. *
  14. * @filesource
  15. * @package Asido.Examples
  16. * @subpackage Asido.Examples.Resize
  17. */
  18.  
  19. /////////////////////////////////////////////////////////////////////////////
  20.  
  21. /**
  22. * Include the main Asido class
  23. */
  24. include('./../../class.asido.php');
  25.  
  26. /**
  27. * Set the correct driver: this depends on your local environment
  28. */
  29. Asido::Driver('gd');
  30.  
  31. /**
  32. * Create an Asido_Image object and provide the name of the source
  33. * image, and the name with which you want to save the file
  34. */
  35. $i1 = Asido::Image('example.png', 'result_05.png');
  36.  
  37. /**
  38. * Resize the image by putting it inside a square frame (300x300) with `rgb(177,77,37)` as background.
  39. */
  40. Asido::Frame($i1, 300, 300, Asido::Color(39, 107, 20));
  41.  
  42. /**
  43. * Save the result
  44. */
  45. $i1->Save(ASIDO_OVERWRITE_ENABLED);
  46.  
  47. /////////////////////////////////////////////////////////////////////////////
  48.  
  49. ?>

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