addwatermark.php 826 B

1234567891011121314151617181920212223242526
  1. <?php
  2. require_once 'bootstrap.php';
  3. //$pixelCraft = new PixelCraft();
  4. $pixelCraft->loadImage('../assets/fox.jpg');
  5. //loading watermark file
  6. $pixelCraft->loadWatermark('../assets/horse.png');
  7. $watermarkX=$pixelCraft->getImageWidth()-150;
  8. $watermarkY=20;
  9. $pixelCraft->drawWatermark(false,$watermarkX,$watermarkY);
  10. $pixelCraft->drawString($watermarkX-40, 150, 'this is watermark', 'red',5);
  11. //sample arrow
  12. $pixelCraft->setLineWidth(5);
  13. $pixelCraft->drawLine($watermarkX-30, 140, $watermarkX, $watermarkY+70, 'white');
  14. $pixelCraft->drawLine($watermarkX, $watermarkY+70, $watermarkX-20, $watermarkY+75, 'white');
  15. $pixelCraft->drawLine($watermarkX, $watermarkY+70, $watermarkX, $watermarkY+95, 'white');
  16. //saving original image type
  17. $originalFileType=$pixelCraft->getImageType();
  18. $pixelCraft->renderImage($originalFileType);