Jul 20, 2008

How To Create Images?

Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > PHP Programming

free web hosting

How To Create Images?

alexia
How can i create images (using php) of 128x128 by giving some types of background... and users can write text on the background... blink.gif

QUOTE
you can take example from the followinbg site:
http://zedge.no/?side=navnelogo

Reply

round
I would just do the thing in flash, seems tons easier than doing it php.
round

Reply

Raptrex
not everyone is good at flash as you are

first you would need to know php
then you can use gd to make images with php

i have a script that does something like that
ill post it if i can find it

Reply

slu
QUOTE(Raptrex @ Jun 23 2005, 10:15 PM)
then you can use gd to make images with php


Just make sure that GD-support is enabled in the PHP you're using (it usually is, but you can always try a call to phpinfo()).

Here's a small example that does what the OP is asking for:

CODE

<?php
if (isset($_REQUEST['img'])) {
 header("Content-type: image/png");
 $image = imageCreateFromPng("background.png");
 $black = imageColorAllocate($image, 0, 0, 0);
 imageString($image, 5, 10, 10, $_REQUEST['img'], $black);
 imagePng($image);
 imageDestroy($image);
 exit;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
 <head>
   <title>Add text to image</title>
 </head>
 <body>
   <form action="<?=$_SERVER['PHP_SELF']?>" method="post">
     Text:
     <input name="text" type="text" value="<?=$_REQUEST['text']?>">
     <input type="submit" value="OK">
   </form>
   <br>
   <img src="<?=$_SERVER['PHP_SELF']?>?img=<?=$_REQUEST['text']?>">
 </body>
</html>


save the above somewhere your webserver can find it and place a png image called background.png in the same directory.

For more information and examples check http://php.net/manual/en/ref.image.php

 

 

 


Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Similar Topics

Keywords : create, images

  1. How To Display Images Of A Directory
    (4)
  2. My Code Doesnt Resize Large Images, Please Help.
    (2)
    Can someone please have a look at the following code, this uploads an image, and make it in 2 sizes,
    one size is max. 600 x 800, uploads to images folder and second 120 x 120 and uploads to thumbs
    folder. this script works fine, with normal size images, but if i try to upload large pics( for
    example, an image with dimension 2432 x 3300, it shows blank page, and uploads the original image
    without sizing to "image" folder, and doesnt make any small thumbnail... I hope u understand..
    Please someone help me, i shall be so thankful. session_start(); header("Cache-contro....
  3. Can You Add Images Into A Mysql Database?
    Using Php? (20)
    I'm learning php in class right now, but I'm still not that good at it, what I'm
    wondering is when I write the php so that it can connect with a database, can I at the same time
    have it that it is able to display back images that I choose. Like, I want a search feature, where
    you can search for a keyword, and it will bring back a list of all the possible entries with that
    keyword, but each of these entries will have a photo associated with it. Now, do I put these image
    files directly into the database, or do I write the code to link them from my files to th....
  4. Securing Images
    (2)
    Just wondering if anyone's worked with securing images to avoid direct linking than just by
    obscuring the URL or using a .htaccess file. I briefly looked through the documentation and source
    for gallery and it looks like the images are stored under the web root, so anyone with a direct link
    can browse the images regardless of user privileges. I was thinking one way of doing this would be
    too store the images above the webroot directory so that visitor's can't navigate to them
    and having a php script that can read the image dir output the images by sending th....
  5. Including Php-made Images In A Page?
    (5)
    Say you have this script that makes an image, and you want to include it in another page. Would you
    just use ? I'd test it right now, but all my PHP image stuff is on my school's server,
    which is currently down.....
  6. Vote Script Help
    images as a result? (1)
    I made a vote poll script, and it work fine with results in numers or %, but i want to show images
    as a result. Is that possible? For example like voting poll in this forum. I tried something but
    that couldnt work. Someone?....
  7. Refreshing Images
    (1)
    I've got a script that generates a graph by creating it as a .png file (I can't output the
    image directly to the browser because of the way I need to generate the data). This all works ok
    however, in order to keep the data managable I've set a limit so that it only displays 12 months
    data at a time. The problem I have is that when I click on the next button to display the next set
    of data, the graph remains the same until you refresh the browser. I've tried using unlink() to
    delete the image file forcing the script to re-generate it when the script is r....

    1. Looking for create, images

Searching Video's for create, images
advertisement



How To Create Images?



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE