Mark an image with a dot

Asked

Viewed 438 times

5

I have a picture of a map and would like to put dots on it. How to do?

  • 1

    Welcome to [en.so], Rodolfo. Your question has already been edited by two users, closed by five others, reopened by a moderator, answered by a star and voted positively by anonymous users. To complete the welcome package only lack the vote -1, which I leave here only as a reminder that it is nice to explain a little better the problem and your current situation when asking a question. The [Ask] guide has more details :)

1 answer

8

If what you really want is what’s in the question, using PHP, a 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 on an image jpeg pre-existing:

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);

?>

Upshot:

comparação entre o mapa original e o processado pelo php

For the drawing functions available in GD, see the relevant part on manual of PHP.

  • As soon as I get home, I’m going to be about the library, I think that’s right, thank you

Browser other questions tagged

You are not signed in. Login or sign up in order to post.