Image_XBM
[ class tree: Image_XBM ] [ index: Image_XBM ] [ all elements ]

Source for file XBM_sample.php

Documentation is available at XBM_sample.php

  1. <?
  2. /**
  3.  * Image_XBM example script.
  4.  * Create XBM, copy photo, draw photo frame and
  5.  * (if Text_Figlet available) draw some text
  6.  *
  7.  * @package Image_XBM
  8.  */
  9.  
  10. include_once 'Image/XBM.php';
  11.  
  12. $xbm = &new Image_XBM;
  13. $xbm->createFromFile('photo.xbm');
  14. $sx = $xbm->getWidth();
  15. $sy = $xbm->getHeight();
  16.  
  17. $out = &new Image_XBM;
  18. $out->create($sx, $sy);
  19.  
  20. // Draw photoframe
  21. $out->setstyle(array(IMAGE_XBM_BLACK, IMAGE_XBM_WHITE, IMAGE_XBM_BLACK, IMAGE_XBM_BLACK, IMAGE_XBM_BLACK));
  22. $out->drawrectangle(0, 0, $sx-1, $sy-1, IMG_COLOR_STYLED);
  23.  
  24. $out->copy($xbm, 5, 5, 5, 5, $sx-10, $sy-10);
  25. $out->drawfiglettext('Hello, Julia!', 'xbriteb.flf', '2x2', IMAGE_XBM_BLACK, IMAGE_XBM_TRANS, 10, 10);
  26. $out->drawfiglettext(' Image_XBM Package ', '6x10.flf', 1, IMAGE_XBM_BLACK, IMAGE_XBM_WHITE, $sx-145, $sy-20);
  27.  
  28. header('Content-type: image/xbm');
  29. $out->output();
  30. ?>

Documentation generated on Mon, 11 Mar 2019 14:28:41 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.