Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

Image problems

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Image problems

Postby border20 » Fri Feb 07, 2003 11:20 am

Here's what i need to do: I have an accident report form. On it, i have a Image button of a human body. When the user clicks the body, it records the coords of the click... this i can do.. but i now need to place a crosshair gif a those coords but i hva ne idea how...

can anyone help out ?
thx
Frank
border20
New php-forum User
New php-forum User
 
Posts: 32
Joined: Tue Jan 28, 2003 10:19 am
Location: Québec

Postby Joan Garnet » Fri Feb 07, 2003 4:34 pm

I think it can be achieved by using javascript and layers...
User avatar
Joan Garnet
Moderator
Moderator
 
Posts: 387
Joined: Sat Aug 03, 2002 2:56 am
Location: Mars

Postby pootergeist » Sat Feb 08, 2003 2:23 am

<div><img src="body.jpg" width="100" height="200" />
<div style="position:relative; top:-150; left:50;">+</div>
</div>

the nested div will be relative to the lower left corner of the containing div (assuming these divs are not within another div)

the top:-150 would place the topleft of the + at 150px upwards from the base

so, it would be something like

$cd = $crosshair-dimension; // width-n-height of +
echo '<div style="position:relative; top:-'. ($imgheight-$ycoord-$cd). 'px; left:'. ($xcoord-$cd). 'px;"><img src="crosshair.jpg" width="'.$cd.'" height="'.$cd.'" /></div';

sort of thing
pootergeist
New php-forum User
New php-forum User
 
Posts: 191
Joined: Wed Jan 29, 2003 7:11 am
Location: UK


Return to PHP coding => General

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron