 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
Aniblaze Grandmaster Cheater Supreme
Reputation: 138
Joined: 23 Apr 2006 Posts: 1757 Location: The Netherlands
|
Posted: Mon Jun 04, 2012 4:40 am Post subject: |
|
|
| potaters wrote: | | B0X wrote: | | should make the length of the image based on the length of characters in the persons steam ID, also you should make the text a different color then green rather then being green, it confused me. |
lmao, I know. I'm trying but it's weird. btw anyone here know regex? |
How may I help you?
|
|
| Back to top |
|
 |
Boxes How do I cheat?
Reputation: 0
Joined: 16 Sep 2007 Posts: 3
|
Posted: Mon Jun 04, 2012 5:09 am Post subject: |
|
|
| Code: |
<?php
header("Content-type: image/png");
$string = $_GET['text'];
$string = " ".$string."";
$im = imagecreatefrompng("images/derp.png");
$lens = strlen($string);
$percent = ($lens * 0.04);
$filename = "images/derp.png";
if ($lens > 20){
$string = " Invalid Name! Too long.";
$percent = strlen($string) * 0.04;
}
$orange = imagecolorallocate($im, 220, 210, 60);
$px = (imagesx($im) - 7.5 * strlen($string)) / 2;
imagestring($im, 3, $px, 9, $string, $orange);
list($width, $height) = getimagesize($filename);
$new_width = $width * $percent;
$new_height = 30;
$image_p = imagecreatetruecolor($new_width, $new_height);
$image = imagecreatefrompng($filename);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
$orange = imagecolorallocate($image_p, 220, 210, 60);
$px = (imagesx($image_p) - 7.5 * strlen($string)) / 2;
imagestring($image_p, 3, $px, 9, $string, $orange);
imagepng($image_p);
imagedestroy($image_p);
?>
|
takes in text and resamples an image based on the text size by a percentage..
height is obviously static and I've added spaces to the main string to make it look nicer
dont know if it will help you but I was bored.
Image I used is attached to this post
I got the percentage bit by dividing the original images height by its width.
| Description: |
|
| Filesize: |
248 Bytes |
| Viewed: |
776 Time(s) |

|
| Description: |
|
| Filesize: |
381 Bytes |
| Viewed: |
785 Time(s) |

|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|