0

How can I draw a horizontal line over image on specific coordinate on asp page using c# code behind this is my image code in aspx page

 <asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
 <!--Content Here-->

    <asp:Image ID="Image1"  runat="server" Width="900" Height="650" />

</ContentTemplate>

</asp:UpdatePanel>

can anyone help me

1 Answers1

0

You can use below code-behind to draw line:

public void DrawLineInt(Bitmap bmp)
{
    Pen blackPen = new Pen(Color.Black, 3);

    int x1 = 100;
    int y1 = 100;
    int x2 = 500;
    int y2 = 100;
    // Draw line to screen.
    using(var graphics = Graphics.FromImage(bmp))
    {
       graphics.DrawLine(blackPen, x1, y1, x2, y2);
    }
}

As refer to this: how to draw a line on a image?