Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here's what ended up working really well.</p> <p>First, the ugly (but necessary) part - mapping where all of the booths are and storing the values. So, for booth1 we would store the four corner points of the area we wanted to highlight.</p> <p>On the image, we use a normal asp:image, but set the ImageUrl to BoothMap.ashx, a handler we've designed to draw the booth locations, sending in the booth location in the querystring. So, it might look like...</p> <pre><code>&lt;asp:Image ID="imgBoothMap" ImageUrl="BoothMap.ashx?ID=A1" runat="server" /&gt; </code></pre> <p>Our handler looks something like this... </p> <pre><code> &lt;%@ WebHandler Language="C#" Class="BoothMap" %&gt; 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; } } } </code></pre> <p>All this provides the framework for us to highlight map locations in ASP.Net. If we wanted to, we could easily modify the code to highlight multiple areas of the map, change colors, etc.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload