How to get images attachment?


  • These are my code I want to get image attachment and edit it now how can I get it look:

    PHP
    1. $im = imagecreatefrompng("icon/boardL.png");


    This is the way to get PNG image I want to get all image an edit them with PHP GD?


  • I want to write text on images which attached.

    Hamed, it's like a watermark?


    Maybe it can help you...



    Name this script, i.e. watermark.php and call this script as following:

    Code
    1. <img src="watermark.php?path=image_name.filetype">


    The only thing you need to chage is "image_name.filetype" and of course you can have the relative path such as:

    Code
    1. <img src="folder/watermark.php?path=folder/imagename">


    The caution here is the script watermark.php and watermark.gif should be in the same location. watermark.gif should have transparent background.


    As you can read it from the site, the location where the watermark.gif appears can be modified by adjusting this line of the code:

    PHP
    1. $startwidth = (($imagewidth - $watermarkwidth)/2);
    2. $startheight = (($imageheight - $watermarkheight)/2);


    To have it appear on the bottom right corner, try this:

    PHP
    1. $startwidth = (($imagewidth - $watermarkwidth) );
    2. $startheight = (($imageheight - $watermarkheight) );


    I hope you find a good usage out of this! :thumbsup: