User not logged in - login - register
Home Calendar Books School Tool Photo Gallery Message Boards Users Statistics Advertise Site Info
go to bottom | |
 Message Boards » » is it possible to write a javascript code that cou Page [1]  
seedless
All American
27142 Posts
user info
edit post

ld convert the text entered into a prompt alert to a specifically sized jpg?

10/8/2005 4:14:59 PM

Incognegro
Suspended
4172 Posts
user info
edit post

no, absolutely not

10/8/2005 4:16:10 PM

seedless
All American
27142 Posts
user info
edit post

also, i also have installed a specific font that i wish the text to be rendered as in the jpg.

10/8/2005 4:17:52 PM

seedless
All American
27142 Posts
user info
edit post

oh, ok. thx.
could you tell me if this is possible in any kind of way?

10/8/2005 4:18:26 PM

Incognegro
Suspended
4172 Posts
user info
edit post

yes, with php or something

10/8/2005 4:20:07 PM

seedless
All American
27142 Posts
user info
edit post

i hate php.

10/8/2005 4:20:52 PM

Incognegro
Suspended
4172 Posts
user info
edit post

well you can do it in any language w/ CGI-bin

but I gather that php is more, like, tailored to this kind of thing

10/8/2005 4:22:06 PM

seedless
All American
27142 Posts
user info
edit post

'like'

10/8/2005 4:22:46 PM

Incognegro
Suspended
4172 Posts
user info
edit post

'as'

omg similes

10/8/2005 4:24:04 PM

Pyro
Suspended
4836 Posts
user info
edit post

Quote :
"<?php

header("Content-type: image/png");
$string = $_GET['text'];
$im = imagecreatefrompng("images/button1.png");
$orange = imagecolorallocate($im, 220, 210, 60);
$px = (imagesx($im) - 7.5 * strlen($string)) / 2;
imagestring($im, 3, $px, 9, $string, $orange);
imagepng($im);
imagedestroy($im);

?>

This example would be called from a page with a tag like: <img src="button.php?text=text">. The above button.php script then takes this "text" string and overlays it on top of a base image which in this case is "images/button1.png" and outputs the resulting image. This is a very convenient way to avoid having to draw new button images every time you want to change the text of a button. With this method they are dynamically generated.
"


PHP needs to be compiled with the GD image library for this to work.

[Edited on October 8, 2005 at 4:29 PM. Reason : http://us3.php.net/image]

10/8/2005 4:27:22 PM

 Message Boards » Tech Talk » is it possible to write a javascript code that cou Page [1]  
go to top | |
Admin Options : move topic | lock topic

© 2024 by The Wolf Web - All Rights Reserved.
The material located at this site is not endorsed, sponsored or provided by or on behalf of North Carolina State University.
Powered by CrazyWeb v2.38 - our disclaimer.