Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Join Date
    Jan 2006
    Location
    Cambridge
    Posts
    1,911
    Tokens
    0

    Latest Awards:

    Default Expanding Image With Text (GD)

    How Would I Get My Image To Expand to the length of the text?
    my current code is:

    PHP Code:
    <?php
    header
    ('Content-type: image/png');
    $text $_GET['text'];
    $im imagecreatefrompng ("bg.png");
    if(
    $text == "ADMINISTRATOR"){ //if administrator
        
    $color imagecolorallocate($im25500); //red
        

    elseif(
    $text == "Ed"){ //if moderator
        
    $color imagecolorallocate($im00255); //blue
        

    elseif(
    $text == "JUNKIE"){ //if junkie
        
    $color imagecolorallocate($im01280); //green
        

    else { 
    //something else...
        
    $color imagecolorallocate($im000); //black
        
    }
        
    $font 'FL.ttf'//font file
    $fontsize 30//font size
    $stringsize imagettfbbox($fontsize0$font$text); //calculate the pixel of the string
    $dx = (imagesx($im)) - (abs($stringsize[2]-$stringsize[0])) - 20//calculate the location to start the text
    imagettftext($im$fontsize1$dx50$color$font$text);
    imagepng($im);
    imagedestroy($im);
    ?>
    +Rep to all helpers

    also how do i keep bg.png still transparent or not even use a bg.png

    Edited by L&#181;ke (Forum Moderator): Thread Moved From Website Designing. Please post in the correct section next time, Thanks .
    Last edited by Lµke; 01-03-2007 at 10:16 PM.
    EDTALKING


  2. #2
    Join Date
    Jul 2005
    Location
    North Wales
    Posts
    4,233
    Tokens
    2,009

    Latest Awards:

    Default

    I'm not sure but I think you need .htaccess, because the image needs to be displayed as yourimagename.png on the .php page, so when you right click it and propertes the end is .png not .php, also this should be in coding.

  3. #3
    Join Date
    Jan 2006
    Location
    Cambridge
    Posts
    1,911
    Tokens
    0

    Latest Awards:

    Default

    the ownage blob guys one is .php :S
    EDTALKING


  4. #4
    ScottDiamond Guest

    Default

    Quote Originally Posted by :Edzy View Post
    the ownage blob guys one is .php :S
    That made me LOL in real.

    PM Blob asking him nicely. :]

  5. #5
    Join Date
    Jul 2005
    Location
    North Wales
    Posts
    4,233
    Tokens
    2,009

    Latest Awards:

    Default

    If you find out please tell me, because atm people have to save the images they make then upload them to a hosting site.

  6. #6
    Join Date
    Dec 2004
    Location
    Essex, UK
    Posts
    3,285
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by redtom View Post
    If you find out please tell me, because atm people have to save the images they make then upload them to a hosting site.
    If you wanna save an image you've generated, do this for example:

    PHP Code:
    imagegif($imagehandle"filename.gif"); 



    i used to be NintendoNews. visit my blog or add me on twitter.
    need help with vista? i am a microsoft certified technology specialist in configuring windows vista and connected home integrator.. pm me for help!


    "I am the way, the truth, and the life. No one comes to the Father except through me"
    John 14:6 (NIV)


  7. #7
    Join Date
    Jan 2006
    Location
    Cambridge
    Posts
    1,911
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by ScottDiamond View Post
    That made me LOL in real.

    PM Blob asking him nicely. :]
    ive asked him on msn for help and he sent me to pixel2life which helped me make this so far and i then asked him if i could use his and he sed he couldnt coz of his co-owner of his site dont want it given out which is fair enough lolz
    EDTALKING


  8. #8
    Join Date
    May 2005
    Location
    San Francisco, CA
    Posts
    7,160
    Tokens
    2,331

    Latest Awards:

    Default

    And that would be me (co-owner).

  9. #9
    Join Date
    Jan 2006
    Location
    Cambridge
    Posts
    1,911
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Invent View Post
    And that would be me (co-owner).
    Do You Give Into Begging
    EDTALKING


  10. #10
    Join Date
    Dec 2006
    Location
    Swindon
    Posts
    3,299
    Tokens
    215
    Habbo
    dunko

    Latest Awards:

    Default

    Lol, speak to me on MSN around 6:30 PM. Im not on my computer at mo.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •