Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get Pixels Values(X and Y) of mouse click 1

Status
Not open for further replies.

DougP

MIS
Dec 13, 1999
5,985
US
I have an image and would like to get the Pixel Values when a user click on it. So when they click on the screen or image it would read say 134-349 Then be able to save those values in an Access database. I can probably do the database part.

TIA
DougP, MCP

Visit my WEB site to see how Bar-codes can help you be more productive
 
Easy.

Just define the image as:
<form action=&quot;somthing.asp&quot; method=&quot;post>
<input type=&quot;image&quot; src=&quot;someimage.gif&quot;>
</form>


In your asp page:

Dim mouseClickX, mouseClickY

mouseClickX = CLng(Request.Form(&quot;Click.x&quot;))
mouseClickY = CLng(Request.Form(&quot;Click.y&quot;)) cquick@callingpost.com
Geographic Information System (GIS), ASP, some Oracle
 
close but It is not returning anythign but
0-0 in my text box

What did I miss
-------------------------------
<html>
<%@ Language=VBScript %>
<head>
<title>Tampa Convention Center</title>
</head>
<body>
<%
Dim mouseClickX, mouseClickY, XYNum
mouseClickX = CLng(Request.Form(&quot;Click.x&quot;))
mouseClickY = CLng(Request.Form(&quot;Click.y&quot;))
XYNum = mouseClickX & &quot;-&quot; & mouseClickY
%>
<form action=&quot;TradeShow2003.asp&quot; method=&quot;post&quot;>
<input type=&quot;image&quot; src=&quot;images/TpaConCtr.jpg&quot;>
<p><input type=&quot;text&quot; name=&quot;XYvalue&quot; Value=&quot;<%=XYNum%>&quot; size=&quot;15&quot;></p>
</form>

<p>Copyright 2001, BarcodeONE Corporation </p>
</body>
</html>
----------------------------
DougP, MCP

Visit my WEB site to see how Bar-codes can help you be more productive
 
Got it
here is the syntax

mouseClickX = CLng(Request.Form(&quot;x&quot;))

drop the &quot;Click.&quot; and just use x DougP, MCP

Visit my WEB site to see how Bar-codes can help you be more productive
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top