473,474 Members | 1,310 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Using ImageMap and displaying circles on it

Hi,

I have some very limited knowledge of web development but I have an
imagemap in which I want to be able to display a small yellow circle at
certain pre-define locations. When the user moves over these circles, I
need to show a small pop-up with info regarding this label.
Here is my Page_Load method:
// These create the hotspots at predefined locations which I'll get
from the database
imageMap.Areas.Add(new ImageMapCircleArea("", new Point(100, 50), 12));
imageMap.Areas.Add(new ImageMapCircleArea(null, new Point(139, 50), 41,
"XXXXXXXXXX"));

imageMap.Areas.Add(new ImageMapCircleArea("", new Point(200, 150),
12));
imageMap.Areas.Add(new ImageMapCircleArea(null, new Point(200, 150),
41, "YYYYYYYYYY"));

imageMap.Areas.Add(new ImageMapCircleArea("", new Point(300, 250),
12));
imageMap.Areas.Add(new ImageMapCircleArea(null, new Point(300, 250),
41, "ZZZZZZZZZZ"));

imageMap.Areas.Add(new ImageMapCircleArea("", new Point(400, 250),
12));
imageMap.Areas.Add(new ImageMapCircleArea(null, new Point(400, 250),
41, "AAAAAAAAAA"));

imageMap.Areas.Add(new ImageMapCircleArea("", new Point(500, 250),
12));
imageMap.Areas.Add(new ImageMapCircleArea(null, new Point(500, 250),
41, "BBBBBBBBBBB"));

//
// HOW DO I ADD CIRCLES TO THE IMAGEMAP AT THIS POINT TO REPRESENT
// EACH OF THE ABOVE POINTS
//

// add the script called by the event handlers
StringBuilder script = new StringBuilder();
script.AppendFormat("<script language=\"javascript\">{0}",
Environment.NewLine);
script.AppendFormat("\tvar image1 = new Image(291, 112);{0}",
Environment.NewLine);
script.AppendFormat("\timage1.src = \"Bham Backdrop.JPG\";{0}",
Environment.NewLine);
script.AppendFormat("\tfunction DisplayImage(image) {0}{1}", "{",
Environment.NewLine);
script.AppendFormat("\t\tdocument.imageMap.src = image.src;{0}",
Environment.NewLine);
script.AppendFormat("\t\treturn true;{0}", Environment.NewLine);
script.AppendFormat("\t{0}{1}", "}", Environment.NewLine);
script.Append("</script>");

Page.RegisterClientScriptBlock("DisplayImage", script.ToString());

Jan 6 '06 #1
0 1548

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: ComputerSmith | last post by:
Hi all. I have programmed VB6 apps before, ones that use dropdown listboxes, text boxes, etc... normal stuff. I was asked by a friend to write a "simple" app that I am unsure how to proceed...
10
by: Imran | last post by:
Hi, I am attempting to create a CSS-driven website, in that I want to be able to control the display/content from the CSS file. I do not want to use tables. On a page, I have a background...
0
by: Alan Wang | last post by:
Hi There, For asp.net 2.0, there is a new web control called imageMap. I am just wondering if there is ONLINE imageMap editor in the market so that programmer doesn't have to figure out the...
5
by: pcnerd | last post by:
I want to create a program that will do graphics like math functions & fractals & stuff. I've been browsing thru books at the bookstores. Apparently, the Point object replaced Pset. The books...
1
by: Mad Scientist Jr | last post by:
I found some info on creating an imagemap in .NET at http://msconline.maconstate.edu/Tutorials/ASPNET2/ASPNET05/aspnet05-04.aspx but in VS.NET I don't see any ImageMap object under...
9
by: Nathan Sokalski | last post by:
I am using ASP.NET 2.0's ImageMap Control to create 2 imagemaps, one directly below the other. When I do this a thin blank space appears between them. After several days of frustration I realized...
1
by: Jeff | last post by:
ASP.NET 2.0 I've got problems with the Width of the ImageMap below. The problem is that the ImageMap's Width doesn't have any effect in my GridView, the width are determine by width of the...
0
by: William Main | last post by:
I have the following code ImageMap image1 = new ImageMap(); image1.Click += new ImageMapEventHandler(ImageMap_Click); image1.HotSpotMode = HotSpotMode.PostBack; image1.ImageUrl =...
0
sanjib65
by: sanjib65 | last post by:
In an ImageMap, when we want to get to any particular place of an Image we usually use some ImageMap properties like Circle/Rectangle/Polygon...etc. and put integer values. What I want to know, is...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.