Results 1 to 4 of 4

Thread: Image create

  1. #1
    Join Date
    Jul 2006
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Image create

    HI,
    Can someone please help me to make an image and put some text into it with PHP. I want to make an image in order to secure my site, and i make a script that put a text to an image. The problem is that i cant put a special font to that text and i dont know how to make it like "~" the text, i don't wont to be a single orizontal text ...i want to make it ondulate Any suggestion will be appreciated! 10X

  2. #2
    Join Date
    Mar 2006
    Location
    Cleveland, Ohio
    Posts
    574
    Thanks
    6
    Thanked 5 Times in 5 Posts

    Default

    Well, here's what I have:

    PHP Code:
    header ("Content-type: image/png");
    $image_text "Sample Text";
            
    $img_handle ImageCreate (23020) or die ("Cannot Create image");
            
    $back_color ImageColorAllocate ($img_handle01010);
            
    $txt_color ImageColorAllocate ($img_handle233114191);
            
    ImageString ($img_handle3155,  $image_text$txt_color);
            
    ImagePng ($img_handle); 
    This creates an image with a black background and pink text.
    It's simple, 230px by 20px.
    Hope that at least gets you down the right path.

    Make sure that there's no line breaks between the opening <? and the header("Content-type: image/png"); part.

    Also, make sure GD is installed on your server.

  3. #3
    Join Date
    Sep 2005
    Posts
    882
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Default

    you mean like a CAPTCHA?

  4. #4
    Join Date
    Jul 2006
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks! ...for your post. That script is good, but i try to use my own font and i change it a little bit. The problem that i had it was because i didn't write to the font url the all url from the home, for example i write "fontName.ttf" and i shoud write "/home/joshua/public_html/fontName.ttf" (i use Linux as OS). Thanks for you script!

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
  •