Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Boredom project
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Random spam
View previous topic :: View next topic  
Author Message
Aniblaze
Grandmaster Cheater Supreme
Reputation: 138

Joined: 23 Apr 2006
Posts: 1757
Location: The Netherlands

PostPosted: Mon Jun 04, 2012 4:40 am    Post subject: Reply with quote

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
View user's profile Send private message
Boxes
How do I cheat?
Reputation: 0

Joined: 16 Sep 2007
Posts: 3

PostPosted: Mon Jun 04, 2012 5:09 am    Post subject: Reply with quote

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.



output.png
 Description:
output image
 Filesize:  248 Bytes
 Viewed:  776 Time(s)

output.png



derp.png
 Description:
 Filesize:  381 Bytes
 Viewed:  785 Time(s)

derp.png


Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Random spam All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites