Login  
Search All Forums
Dart Home | PowerWEB Zoom for ASP.NET | Custom Development Reply | PowerWEB Zoom for ASP.NET Topics | Forums   
AuthorForum: PowerWEB Zoom for ASP.NET
Topic: Get the X, Y coördinates from the IMAGE on mouseclick
g78stef

From: Oostende, Belgium
Posts: 3
Member Since: 09/26/07
posted September 26, 2007 12:48 PM

When someone clicks somewhere on the image, I need the X, Y coördinates from the Image itself and not of the location on the Webform!

I need this for image manipulation for the OCR software!

I would prefere a client-side javascript to receive a event 'onmouseclick' or 'ondoublemouseclick'
K M Drake



From: Utica, NY USA
Posts: 3406
Member Since: 07/14/00
posted September 27, 2007 9:47 AM

Hi,
To get the location of the click:

//e is passed in event
var x, y;
x = e.clientX - pwzGetElementLeft(document.getElementById('Zoom1'));
y = e.clientY - pwzGetElementTop(document.getElementById('Zoom1'));

You may also need the zoom location of the image:

var zoomX, zoomY, zoomZ;
zoomX = pwCurZoom.getX();
zoomY = pwCurZoom.getY();
zoomZ = pwCurZoom.getZ();

Hope it helps,
-ken
g78stef

From: Oostende, Belgium
Posts: 3
Member Since: 09/26/07
posted September 27, 2007 1:13 PM

This is not really wat i'm looking for!

When a image is zoomed in, the e.clientX or e.clientY is NOT the same when the image is Not zoomed in.

Therefor I really need the X,Y position of the IMAGE IN the control. I'm nothing with the X,Y click position in the control!
g78stef

From: Oostende, Belgium
Posts: 3
Member Since: 09/26/07
posted September 27, 2007 1:17 PM

the pwCurZoom could be a solution but ...

how can I raise the ondoublemouseclick event for javascript?

 <cc1:Zoom runat="server" ID="Zoom1" OnDoubleClick="setCoords()" NavigationLayout="Vertical"        SourceImage="D:\Develop\PlanViewer\TEST.jpg" />

if my javascript function is :

function setCoords()
{
alert("ok");
document.getElementById("txtX").value = pwCurZoom.getX();
document.getElementById("txtY").value = pwCurZoom.getY();
document.getElementById("txtZ").value = pwCurZoom.getZ();

}


The countrol doesn't fire the javascript function?!
K M Drake



From: Utica, NY USA
Posts: 3406
Member Since: 07/14/00
posted September 28, 2007 9:05 AM

Hi,
You would add the attribute like this:

ondblclick="setCoords()"

OnDoubleClick is for the server-side event.

Hope it helps,
-ken
Reply | PowerWEB Zoom for ASP.NET Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX