Re: Re: How to create a button with a icon inside ?

From: Date: Sun, 08 Jul 2001 17:44:47 +0000
Subject: Re: Re: How to create a button with a icon inside ?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-56784@lists.php.net to get a copy of this message
Argh, responded to the wrong list. Apologies. :-) /* Chris Lambert, CTO - chris@whitecrown.net WhiteCrown Networks - More Than White Hats Web Application Security - www.whitecrown.net */ ----- Original Message ----- From: Chris Lambert <clambert@gamespy.com> To: Mauro Ferreira <mauroferreira@enersulnet.com.br> Cc: <php-general@lists.php.net> Sent: Sunday, July 08, 2001 1:43 PM Subject: [PHP] Re: How to create a button with a icon inside ? | <? | Header("Content-type: image/png"); | $font = "php.ttf"; | if(!$si) $si = 66; | $im = ImageCreateFromPNG("php-blank.png"); | $tsize = imagettfbbox($si,0,$font,$text); | $dx = abs($tsize[2]-$tsize[0]); | $dy = abs($tsize[5]-$tsize[3]); | $x = ( imagesx($im) - $dx ) / 2; | $y = ( imagesy($im) - $dy ) / 2 + 3*$dy/4; | $blue = ImageColorAllocate($im,0x5B,0x69,0xA6); | $white = ImageColorAllocate($im,255,255,255); | $black = ImageColorAllocate($im,0,0,0); | ImageTTFText($im, $si, 0, $x, $y, $white, $font, $text); | ImageTTFText($im, $si, 0, $x+2, $y, $white, $font, $text); | ImageTTFText($im, $si, 0, $x, $y+2, $white, $font, $text); | ImageTTFText($im, $si, 0, $x+2, $y+2, $white, $font, $text); | ImageTTFText($im, $si, 0, $x+1, $y+1, $black, $font, $text); | ImagePNG($im); | ?> | | ..from one of the PHP conferences. | | "php.ttf" is the font | | "php-blank.png" is the base image | | $text is the text you want to write, and $si is the size of the font | ______________________________ | / Chris Lambert - cjlambert@home.com | |-> ICQ #: 16435685 - AIM: ClipperChris | `-> Cell: (401) 743-2786 - http://sms.clambert.org/ | ----- Original Message ----- | From: Mauro Ferreira <mauroferreira@enersulnet.com.br> | Newsgroups: php.gtk | To: <php-gtk@lists.php.net> | Sent: Sunday, July 08, 2001 1:10 PM | Subject: How to create a button with a icon inside ? | | | Can someone show me a example ? | | I'm doing some refinements in an database-oriented app, and show database | navigation and action buttons with small icons instead of text will do a lot | for the visual - and cuts a lot in internationalization too ! | | If isn't ask for too much, a example of a combined icon+text button too will | be great too - some not-so-obvious actions, like data integrity check need a | text anyway. | | Know how to make this will simplify my work a lot, not to mention the visual | aspect. | | Thanks ! | | | | -- | PHP General Mailing List (http://www.php.net/) | To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net | For additional commands, e-mail: php-general-help@lists.php.net | To contact the list administrators, e-mail: php-list-admin@lists.php.net | | |

« previous php.general (#56784) next »