How to draw lines on an Image using asp.net(GDI+) RRS feed

  • Question

  • User2069745655 posted
    This is bharath.I am working on Project called Tiger Project, where we should be drawing lines on images and measure the distance between two points,calculate area of an ellipse,etc.Are these things possible in asp.NET? We usually collect PAW prints of tigers to calculate the existing Tigers.In order differentiate two tigers we need to assign some parameters.So we had to measure the distances between their Toes to differentiate them.Secondly when I move my mouse on the Image I need to know the co-ordinates
    (x,y values) in status bar and when I click on an Image point.The co-ordinate values should be inserted in to textboxes.
    This is the prob.I hope U guys understand me!!If this is MESS!!Just help me how to draw lines,join them and calculate area of ellipses,square,rectangle formulaes,etc on an Image and that display x and y co-ordinates in status bar dynamically where ever I move.....U sually we see in mouseover events.....

    HELP ME!!!!![:P][:S][8-)]

    Tuesday, November 29, 2005 12:02 AM

All replies

  • User-117007243 posted

    Hi Bharath,

    The same query aplicable for my project. did u got any solution for that? if yes can u help me...





    Monday, August 4, 2008 12:21 AM
  • User-232511291 posted

     well Bharath  am not all verse with GDI+ but the problem looks possible but for the second question that you talked about i have already done the same 


    in this application i have used a <asp:pane /> inside the pane when ever i move my mouse you get the co-ordinates on the two text boxes below ,one being for the X co-ordinate and the second being for the Y co-ordinate

    This i swhat i did at the aspx page

        <form id="Form1" runat="server" method="post">
            <input id="hidX" name="hidX" type="hidden">
            <input id="hidY" name="hidY" type="hidden">
            <asp:panel id="Panel1"  runat="server" borderstyle="Solid" height="600" width="900" ></asp:panel>
                <input name="xPos" size="5" type="text"></p>
                <input name="yPos" size="5"  type="text"></p>
            <asp:Label ID="Label1" runat="server"></asp:Label>

            <script language="JavaScript">

    function getPanelMouseCoOrds()
    var mouseX = event.clientX + document.body.scrollLeft;
    var mouseY = event.clientY + document.body.scrollTop;

    document.Form1.xPos.value = mouseX;
    document.Form1.yPos.value = mouseY;

    document.Form1.hidX.value = mouseX;
    document.Form1.hidY.value = mouseY;
    return true;

    function handlePanelClick()



    not we goota add a small piece of code in the code file too

    all of this goes in the page load


     if (!Page.IsPostBack)
                Panel1.Attributes["onmousemove"] = "getPanelMouseCoOrds()";
                Panel1.Attributes["onclick"] = "handlePanelClick()";
                int panelX = Int32.Parse(Request.Form["hidX"]);
                int panelY = Int32.Parse(Request.Form["hidY"]);
                Label1.Text = "YOU CLICKED X_CORD: " + panelX + ",Y_CORD: " + panelY;

     HOpe this helps

    ill try out with the first question as well will let know if i get any solutions to it 

    Monday, August 4, 2008 4:04 AM