Home > Archive > PERL CGI Beginners > August 2006 > Image Manipulation
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Image Manipulation
|
|
|
| I'm losing my mind with this one. Here's what I want to be able to do:
I have an image on a web page. I want to allow the users to place a
small "dot" or gif marker on the image. I then want this information
to be saved to the server (no database) so when the next user views the
web site, the dot from the previous user will be visible. Is this
possible with Perl? Please help me! Thanks.
| |
| Jimi-Carlo Bukowski-Wills 2006-08-08, 6:55 pm |
| On Tue, 08 Aug 2006 07:20:09 -0700, Bliv wrote:
> I'm losing my mind with this one. Here's what I want to be able to do:
> I have an image on a web page. I want to allow the users to place a
> small "dot" or gif marker on the image. I then want this information
> to be saved to the server (no database) so when the next user views the
> web site, the dot from the previous user will be visible. Is this
> possible with Perl? Please help me! Thanks.
Have you any code so far???
There are several parts to this problem...
1) Place a dot on the image...
a) Use perl/gd or php image routines to draw the dot
this would require using an input type=image or similar and
grabbing the x,y coords of the click from the query string.
Then you can place the dot on the image and save it...
referring to it in the page you print back to the browser
b) Use DHTML to position the dot
this would require an onmousedown routine to store the
clientX/Y coords. You could enter them into a form and]#
submit that or use AJAX and submit it immediately...
You'd have to have a dot.gif image that you could position
over the original.
2) Store the information
a) Store the image
You'd do this in part 1a
b) Store the coords...
i) in a cookie
ii) in a session
iii) in a file
iv) in a database
3) Print the new image with the dot already on it...
a) Refer to the stored image
b) Look-up the coords of the image and position the dot
using css
| |
|
| No code so far. I like your DHTML idea. For my purposes, I think it
is the way for me to go. Thank you for your assistance. Believe it or
not, I am an experienced programmer...just not with Perl. I just
needed a nudge in the right direction. Thanks again.
Cheers,
Bliv
Jimi-Carlo Bukowski-Wills wrote:
> On Tue, 08 Aug 2006 07:20:09 -0700, Bliv wrote:
>
>
> Have you any code so far???
>
> There are several parts to this problem...
>
> 1) Place a dot on the image...
> a) Use perl/gd or php image routines to draw the dot
> this would require using an input type=image or similar and
> grabbing the x,y coords of the click from the query string.
> Then you can place the dot on the image and save it...
> referring to it in the page you print back to the browser
> b) Use DHTML to position the dot
> this would require an onmousedown routine to store the
> clientX/Y coords. You could enter them into a form and]#
> submit that or use AJAX and submit it immediately...
> You'd have to have a dot.gif image that you could position
> over the original.
> 2) Store the information
> a) Store the image
> You'd do this in part 1a
> b) Store the coords...
> i) in a cookie
> ii) in a session
> iii) in a file
> iv) in a database
>
> 3) Print the new image with the dot already on it...
> a) Refer to the stored image
> b) Look-up the coords of the image and position the dot
> using css
| |
| Jimi-Carlo Bukowski-Wills 2006-08-09, 3:55 am |
| On Tue, 08 Aug 2006 10:26:51 -0700, Bliv wrote:
> No code so far. I like your DHTML idea. For my purposes, I think it
> is the way for me to go. Thank you for your assistance. Believe it or
> not, I am an experienced programmer...just not with Perl. I just
> needed a nudge in the right direction. Thanks again.
>
> Cheers,
>
[snip]
You new on newsgroups? It's convention to post your reply below the
original. I don't care personally, but lots of people get really shirty
about it.
Anyway, I just remembered that I have some pages that already do exactly
what you're asking...
http://www.webu.co.uk/compass/
It's a generic 2-axis non-discreet polling system. The example is a
good/evil justifiable/non-justifiable compass.
You get given a scenario and you click on where you think the action lies
on the compass... was it good/evil, was it justifiable/not.
A cross appears on the compass where they clicked.
If you're interested I'll give you the code, but it's PHP not Perl.
|
|
|
|
|