Results 1 to 4 of 4

Thread: How to Create image in PHP ?

  1. #1
    Join Date
    Jan 2009
    Posts
    16

    How to Create image in PHP ?

    I try to create an image in PHP with imagecreate () function. I wonder if it is possible for a user to download an image as their logo and use that in the image that I create? I know that you can use an existing image to imagecreatefrompng () function, but I also want to add an image to the imagecreate (). but didn't work can anyone help me ?

    Thanks

  2. #2
    Join Date
    Aug 2008
    Posts
    46

    Re: How to Create image in PHP ?

    If you are sure that the downloaded file is safe to work with you to determine what type of image it is, then use the "* imagecreatefrom" function for this type of pointing the way to the uploaded file.

  3. #3
    Join Date
    Oct 2008
    Posts
    54

    Re: How to Create image in PHP ?

    Don't use gif unless you have an old version of GD (I doubt it) use png instead. heres a simple example:
    <?php
    header("Content-type: image/png");
    $image = imagecreate( 200, 200 );
    imagecolorallocate($image,200,100,100);
    imagepng($image);
    imagedestroy($image);
    ?>

  4. #4
    Join Date
    May 2008
    Posts
    29

    Re: How to Create image in PHP ?

    Create a 200x200 square (and a bit more)

    PHP Code:
    <?php
    create_image
    ();
    print 
    "<img src=image.png?".date("U").">";

    function  
    create_image(){
            
    $im = @imagecreate(200200) or die("Cannot Initialize new GD image stream");
            
    $background_color imagecolorallocate($im2552550);  // yellow
            
    imagepng($im,"image.png");
            
    imagedestroy($im);
    }
    ?>

Similar Threads

  1. How to create Image to burn?
    By YajasK in forum Windows Software
    Replies: 3
    Last Post: 10-03-2012, 12:58 PM
  2. How to create Image of NT Server
    By RamBarose in forum Networking & Security
    Replies: 4
    Last Post: 12-01-2011, 07:45 PM
  3. How to create image library ?
    By Balgovind in forum Windows Software
    Replies: 3
    Last Post: 06-04-2009, 01:35 PM
  4. How to create a 3D image
    By TechyGuy in forum Guides & Tutorials
    Replies: 6
    Last Post: 21-03-2009, 09:05 PM
  5. Need help to create iso image of WINPE 2.0
    By adrin in forum Vista Setup and Install
    Replies: 2
    Last Post: 14-06-2007, 02:14 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,195,693.46090 seconds with 17 queries