Creating an image map for Gdlib generated image

images php coding issues or problems here.

Moderators: macek, egami, gesf

Post Reply
User avatar
ruturajv
php-forum Super User
php-forum Super User
Posts: 1280
Joined: Sat Mar 22, 2003 9:42 am
Location: Mumbai, India
Contact:

Post by ruturajv » Tue Feb 01, 2005 8:23 pm

but do you know what positions do you have to create the image map... ?

User avatar
ruturajv
php-forum Super User
php-forum Super User
Posts: 1280
Joined: Sat Mar 22, 2003 9:42 am
Location: Mumbai, India
Contact:

Post by ruturajv » Wed Feb 02, 2005 7:39 pm

- Since I have no way of telling which categories, sub-categories and products exists in advance, i do not know the areas, I want to map ind advance.

If you don't know where they belong then how can you even link those products or categories...
ie. if you know the category they fall... then how can you href category?id=4 something like that... ?

User avatar
ruturajv
php-forum Super User
php-forum Super User
Posts: 1280
Joined: Sat Mar 22, 2003 9:42 am
Location: Mumbai, India
Contact:

Post by ruturajv » Thu Feb 03, 2005 8:27 pm

ok then I think it is simple....
consider... this...
  • you make a function where you actually calculate the co-ordinates...
  • use that function to create your image
  • in the (html|php) where you display graph...

    Code: Select all

    <map name="..">
    <?php
    include 'function_file.php';
    $values = call_the_function();

    // now echo the co-ordinates
    ?>
    </map>

User avatar
ruturajv
php-forum Super User
php-forum Super User
Posts: 1280
Joined: Sat Mar 22, 2003 9:42 am
Location: Mumbai, India
Contact:

Post by ruturajv » Sun Feb 06, 2005 7:21 pm

1) Make function to calculate koordinates
2) (In the same function draw the picture)
3) include the function when the picture is inserted in php


hi,
the 2nd pt is incorrect... just include the function script, and in another script create all the necessary image manipulations, like colors, borders, etc.

and the script where u generate image...

Code: Select all

<?php
...
include_once 'co-ordinate-calculating-function-only.php';
$img = imagecreate(...);

...
all the processing...
... and finally..

header("Content-Type: image/png");
imagepng($img);
?>


this is the solution where you do not have to save the image anywhere !
Just let me know if ya understand or I'll mail you your code... :D

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest