Computers |
|
| | #1 (permalink) |
| All round good guy! | You may, (or may not) have noticed the image i use in the new members area now and again. I'm getting pretty quick at creating them but, let's face it, it's getting a tad tedious. I'm wondering if someone could shed some light on this one ![]() Firstly, the codes. PHP tfgenerate.php http://193.111.226.179/tfgenerate.php Code of tfgenerate.php Code: <?php
header('Content-type: image/png');
$text = $_GET['text'];
$im = imagecreatefrompng ("tech forums.png");
$color = imagecolorallocate($im, 0, 0, 0);
$font = 'font.ttf';
$fontsize = 24;
$size = imagettfbbox($fontsize, 0, $font, $text); //calculate the pixel of the string
$dx = (imagesx($im)) - (abs($size[2]-$size[0])) - 20; //calculate the location to start the text
imagettftext($im, $fontsize, 0, $dx, 35, $color, $font, $text);
imagepng($im);
imagedestroy($im);
?> Now, we all know where I need things to go :P Heres a sample: ![]() Hoping CrazeD or someone can help me out ![]() Cheers, ~ Tkey |
| | |
| | #5 (permalink) |
| Ultra Techie Join Date: Oct 2007
Posts: 630
| Try using this to smooth the text (not 100% sure if it works on text or not): PHP Code: Like: PHP Code:
__________________ Last edited by zedman3d; 07-13-2008 at 06:48 AM. |
| | |
| | #6 (permalink) |
| All round good guy! | The text smoothing you suggested did nothing ![]() I'm not quite sure why there is such a loss of quality, since the filetype is set to PNG and the file is a PNG. Could this be something to do with the PHP running on my server? Cheers, ~ Tkey |
| | |
| | #10 (permalink) |
| Ultra Techie Join Date: Oct 2007
Posts: 630
| Okay dont go off at me, but i cant actually get that code to work. I have GD installed and everything but it throws errors galore. But obviously, its working for you so ill try to help. Try keeping the AntiAliasing code i have. Even if its doing nothing, it cant make things worse. Next, swap PHP Code: PHP Code: |
| | |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Double clicking an image opens windows photo gallery instead of preview the image | djfiasco | Windows Operating Systems and Software | 10 | 03-03-2008 10:35 PM |
| Copying gif image | Nick | Web Graphics, design, digital images | 10 | 01-08-2008 10:10 AM |
| Macromedia Dreamweaver Image Issue | westy159 | Web Graphics, design, digital images | 5 | 12-07-2007 01:35 PM |
| Added 1 Gig of Ram and CPU is SLOWER!? | czarnybaran5150 | Building, Buying, or Upgrading High Performance PC Systems | 0 | 08-07-2007 11:09 PM |
| Browser Resize image question | Murdoc | Programming Discussions | 1 | 07-23-2007 03:22 PM |