Select image areas in ASP.Net

I have a map of the building, and I would like to programmatically highlight specific rooms based on user input.

I would like to do this from the server, if possible, and, in the end, I would like to allocate several rooms. To stop in more detail, this function is intended for the exhibition. Users will view the data on the exhibitor, click on the stand and present a map of the hall with highlighted stands.

I would also like to later include “bookmarking” exhibitors, therefore, to make it worthwhile, while we should be able to easily highlight several stands.

What is the best way to do this?

+3
source share
3 answers

jQuery Map Hilight , , , .

jQuery Map Hilight

+3

.

-, ( ) - , . , 1 , .

asp: image, ImageUrl BoothMap.ashx, , , , . , ...

<asp:Image ID="imgBoothMap" ImageUrl="BoothMap.ashx?ID=A1" runat="server" />

:

 <%@ WebHandler Language="C#" Class="BoothMap" %>

using System.Drawing;
using System.Drawing.Imaging;
using System.Web;

public class BoothMap : IHttpHandler {

    public void ProcessRequest (HttpContext context) {

        context.Response.ContentType = "image/jpg";

        //load booth corners
        Point[] points = GetBoothCorners(context.Request.QueryString["ID"]);

        Image curImage = Image.FromFile(@"C:\BoothMap.jpg");
        Graphics g = Graphics.FromImage(curImage);
        Pen transPen = new Pen(Color.FromArgb(128, 132, 112, 255), 10);
        Brush transBrush = new SolidBrush(Color.FromArgb(128, 132, 112, 255));
        g.FillPolygon(transBrush, points);
        curImage.Save(context.Response.OutputStream, ImageFormat.Jpeg);
        g.Dispose();
        curImage.Dispose();
        context.Response.End();
    }

    public bool IsReusable {
        get {
            return true;
        }
    }
}

ASP.Net. , , , ..

+1

. , , , building.jpg. ( building-room1.jpg, building-room2.jpg) .. ( - MSPaint ). Image ImageUrl.

Image Map ASP.NET 2.0, , " , .

0

Source: https://habr.com/ru/post/1702211/


All Articles