Mark an image with a period

4

I have an image of a map and would like to put points on it. How to do?

    
asked by anonymous 31.10.2014 / 13:32

1 answer

7

If what you want is what is in the question, using PHP, one solution is to use the GD library for this, which usually comes pre-installed in PHP distributions.

See an example that draws a small red circle in a preexisting jpeg image:

meumapa.php :

<?php

    $im = imagecreatefromjpeg( 'meumapa.jpg' );

    $cor = imagecolorallocate( $im, 255, 0, 0 );
    imagefilledellipse( $im, 110, 135, 8, 8, $cor );

    header('Content-Type: image/jpeg');
    imagejpeg($im);
    imagedestroy($im);

?>

Result:

ForthedrawingfunctionsavailableinGD,seetherelevantpartinthe manual / a> of PHP.

    
31.10.2014 / 13:38