Ask a Question related to PHP Development, Design and Development.
-
Cybex #1
Dynamic Image?
Who knows how this is done:
[url]http://www.danasoft.com/vipersig.jpg[/url]
As you can see the signature is dynamical, it uses gdlib I assume and php.
But does anybody have any code for this? Please help me find this, I
allready searched alot, but can't seem to find anything yet...
Regards, Cybex
Cybex Guest
-
dynamic image gallery
I'm trying to create a dynamic image gallery that is updated from a database, i managed to create a simple mysql database using phpmy admin, so I... -
dynamic image
hey everyone just a quick and probably stupid question here. i have a list of features in my access database that are related to my products. i... -
Dynamic Image Map (ASP)
Like most product websites all our product info pages are populated using a database and ASP. Now one of the dynamically generated content is an... -
dynamic image map
Based on certain variable in a javascript, can I somehow hide an image map? I can't seem to be able to target the map.....any thoughts? Thanks ,,... -
Dynamic image that can be emailed?
I want to create something on my website that allows the user to arrange image pieces (sort of like a puzzle) and then email the final result to... -
Shawn Wilson #2
Re: Dynamic Image?
Cybex wrote:
ImageMagick would work well for this, if it's installed on your server.>
> Who knows how this is done:
>
> [url]http://www.danasoft.com/vipersig.jpg[/url]
>
> As you can see the signature is dynamical, it uses gdlib I assume and php.
> But does anybody have any code for this? Please help me find this, I
> allready searched alot, but can't seem to find anything yet...
>
> Regards, Cybex
If you have Telnet or SSH:
whereis ImageMagick
will tell you where it is.
Shawn
--
Shawn Wilson
[email]shawn@glassgiant.com[/email]
[url]http://www.glassgiant.com[/url]
Shawn Wilson Guest
-
Richard Hockey #3
Re: Dynamic Image?
"Cybex" <cybex.Ihatespam@home.nl> wrote in message
news:biijn1$887$1@news1.tilbu1.nb.home.nl...PHP to generate a horizontal bar graphic in a PNG file when called with a> Who knows how this is done:
>
> [url]http://www.danasoft.com/vipersig.jpg[/url]
>
> As you can see the signature is dynamical, it uses gdlib I assume and php.
> But does anybody have any code for this? Please help me find this, I
> allready searched alot, but can't seem to find anything yet...
URL parameter 'precent'
makepng.php
<?php
// read url parameter 'percent'
$percent=$_GET["percent"];
// calculate size of bar
$x1=floor(460*($percent/100));
// build image
$im = ImageCreate(500, 50);
// set colours, first colour created is background
$black = ImageColorAllocate($im, 0, 0, 0);
$white = ImageColorAllocate($im, 255, 255, 255);
$red = ImageColorAllocate($im, 255, 0, 0);
// set up array defining vertices of hexagonal bar, width depends on
'percent' parameter
$points=array(10,25,20,45,($x1+20),45,($x1+30),25, ($x1+20),5,20,5);
// draw polygon using array 'points' and colour red
imagefilledpolygon($im,$points,6,$red);
// write text on top of bar
imagestring($im,5,20,20,$percent.'%',$white);
// send the image to the browser
header("Content-type: image/png");
ImagePNG($im);
// tidy up
ImageDestroy($im);
?>
and an example of a page using the above code
<html>
<head>
<title>dynamic image</title>
<script type="text/javascript">
function graph(gaugeID)
{
var n=20;
var time=new Date();
var n=time.getSeconds();
n=Math.floor((n*100)/60);
document.getElementById(gaugeID).src='makepng.php? percent='+n;
var temp=setTimeout("VUgauge('gauge1')",1000);
}
</script>
</head>
<body onload="graph('placeholder');">
<img id="placeholder">
</body>
</html>
> Regards, Cybex
>
>
Richard Hockey Guest



Reply With Quote

