Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old May 10th, 2006, 01:58 AM
Friend of Wrox
Join Date: Jun 2004
Posts: 449
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to r_ganesh76
Default Marking on Image

Hi Experts,

I am working on a project which manages our office space. I have an image of the office layout and I want to mark the co-ordinates as and when the user clicks and store it to a database.

Can anyone tell me which is the easiest way of doing this?

Thanking in advance

Find your solution here...
Old May 11th, 2006, 01:10 PM
Authorized User
Join Date: May 2006
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts

It is helpful to know which browser you are using. For IE 6, the following will work.

<html xmlns="http://www.w3.org/1999/xhtml" >
    <title>Test Filter</title>
    <script language="javascript">
        function Image_Click ()
            alert ("(" + window.event.offsetX + ", " + window.event.offsetY + ")");

    <img src='<< your path here>>' onclick="Image_Click();" />


You have a few choices on how to save the data once gathered:

1. Put those coords into hidden fields and post the page.
   It might be annoying for the page to disappear and redraw after every click...

2. Use a hidden iframe to do the same thing, only the iframe gets posted, not the whole page.
   If the user clicks quickly, the iframe may not have reloaded before the next input, so an error will occur. Also, this is really only an IE solution.

3. Setup a web-service that can listen for XML HTTP requests and save the coords as needed.
   This is a super-slick solution that is somewhat complicated. Fortunately, a Web service is easy to setup in ASP.NET 2.0. You might start with http://msdn.microsoft.com/msdnmag/is...e/default.aspx


Similar Threads
Thread Thread Starter Forum Replies Last Post
Upload image-create & save thumbnail-display image angshujit ASP.NET 2.0 Professional 6 July 11th, 2013 10:34 PM
Loading Image to Image Control using JavaScript ctranjith General .NET 1 May 28th, 2013 05:43 AM
Copy kodak image edit control's image to clipboard vishwanathduddilla Visual Studio 2005 0 November 3rd, 2008 10:10 AM
set image on <asp:Image> stored in DataBase myself.panku ASP.NET 2.0 Professional 1 August 11th, 2008 10:41 AM
Document Image Processing (DIP) - changing image f ALcom Access 0 March 27th, 2006 06:10 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.