473,749 Members | 2,384 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

GDI+ and Image Maps

Is it possible to use image maps to divide up a picture acting as an image
button?

I have created a map of a building, and now I want to have some sort of
pop-up messages when certain parts of the building are moused over. The
only way I can think to do this (without using javascript), is to divide the
image into sections with an image map and have the pop-ups display my info.
I've never made an image map before, nor have I dealt with asp.net image
buttons up until recently. I just wanted to confirm the feasibility before
I learn image maps and spend a whole day trying to make them work right.

Please help me if you have time.

-Kevin

P.S. Below is the code, in case you're interested in what I'm doing.
Replace acg.gif with a map, and diamond_pink.gi f with a marker (mine is an
11x11px diamond). You can click on the map and that's where the diamond
comes up. I'm recording the coordinates in a database, and that alllows me
to see where my computers are. I just need an easy, intuitive, way to
identify the computers.

**** map.aspx ****

<%@ import namespace="syst em.drawing" %>

<script runat="server">

sub Page_Load
if not ispostback then
ibtnmap.imageur l = "rendermap.aspx "
end if
end sub

sub ibtnmap_click(s as object, e as imageclickevent args)
ibtnmap.imageur l = "rendermap.aspx ?x=" & e.x & "&y=" & e.y
response.write( "x is: " & e.x & ", y is: " & e.y)
end sub

</script>

<html>
<body>
<form runat="server">
<asp:imagebutto n
id="ibtnmap"
onclick="ibtnma p_click"
runat="server"
/>
</form>
<body>
</html>

**** rendermap.aspx ****

<%@ page contenttype="im age/gif" %>
<%@ import namespace="syst em.drawing" %>
<%@ import namespace="syst em.drawing.imag ing" %>

<script runat="server">

sub Page_Load
dim objbitmap1 as bitmap
dim objbitmap2 as bitmap
dim objstarbitmap as bitmap
dim objgraphics as graphics
dim xcoor as integer = request.queryst ring("x")
dim ycoor as integer = request.queryst ring("y")

objstarbitmap = new bitmap("c:\pcca snmp\_images\di amond_pink.gif" )
objbitmap1 = new Bitmap("c:\pcca snmp\_images\ac g.gif")
objbitmap2 = new bitmap(objbitma p1.width, objbitmap1.heig ht)
objgraphics = graphics.fromim age(objbitmap2)
objgraphics.dra wimage(objbitma p1, new rectangle(0,0,o bjbitmap2.width ,
objbitmap2.heig ht),0,0,objbitm ap1.width,objbi tmap1.height,gr aphicsunit.pixe l
)
objgraphics.dra wimage(objstarb itmap,new rectangle(x - 5,y -
5,11,11),0,0,ob jstarbitmap.wid th,objstarbitma p.height,graphi csunit.pixel)

objbitmap2.save (response.outpu tstream,imagefo rmat.gif)

end sub

</script>
Nov 17 '05 #1
0 1472

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

Similar topics

4
2216
by: Stanimir Stamenkov | last post by:
I have this kind of construct: http://www.geocities.com/stanio/temp/usemap01.html (an IMG element using MAP described with AREA elements) I'm trying to make it more accessible and currently I'm testing in Lynx. Lynx plays it clever and when I "enter" the map it shows only 3 links no matter there are 5 AREAs (3 point to a same reference). I don't like Lynx displays the 'alt' text and not the link titles
4
48239
by: Michael Kennedy [UB] | last post by:
Hi Everyone, I have this multithreaded C# windows forms application which does a lot of image processing. Occasionally, I get the following error: A generic error occurred in GDI+. System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+. at System.Drawing.Image.Save(String filename, ImageCodecInfo encoder, EncoderParameters encoderParams)
5
4139
by: anonymous | last post by:
I'm writing a program that deals extensively with the printer. For the most part my application runs fine, but occasionally I run into some Exceptions. The most common exceptions I run into are NullReferenceException and InvalidOperationException : The object is currently in use elsewhere. Unfortunately this appears to be a race condition. These exceptions appear to ocurr while disposing GDI+ objects, the Graphics object seems to be the...
1
16229
by: Prasad More | last post by:
Hello, I am trying to write a text on Multi-page TIFF image using C# and .NET GDI+. I have written following code to do this. When I execute this code I get "Invalid Parameter User. at System.Drawing.Image.Save" error. public void addAnnotationStampOnImage() { string strStamp = Path.GetFileNameWithoutExtension(_ImageFileName); Size dSize; Image iMulti = Image.FromFile(_ImageFileName);
7
3224
by: news | last post by:
This may be a stupid question, but if I don't ask I'll never know ;) Ok, here it goes.... I am writing an application that renders an image in one picturebox and a graph in another. The image is drawn by loading a jpg into a bitmap and then setting picturebox.image = mybitmap. Ive created my own class, inheriting from the picturebox and overriding the OnPaint event so I can do e.Graphics.DrawImage (this.image....). This renders...
13
4660
by: lgbjr | last post by:
Hello All, I have some pictureboxes on a VB.NET form that are linked to an AccessDB. If the user wishes to open or edit an image, I need to save the image in the picturebox to a temp file, then open that file in whatever viewer/editor is the default for the users system. I tried to do picturebox1.image.save(filename), which results in "A Generic error occured in GDI+". However, if I use an unbound picturebox, do a
15
5362
by: David Lozzi | last post by:
Howdy, I have a function that uploads an image and that works great. I love ..Nets built in upload, so much easier than 3rd party uploaders! Now I am making a public function that will take the path of the uploaded image, and resize it with the provided dimensions. My function is below. The current function is returning an error when run from the upload function: A generic error occurred in GDI+. Not sure what exactly that means. From what...
6
4757
by: David Stone | last post by:
I have a simple question about the alt content of area elements within an image map: is it redundant to include phrases such as "link to..." or "jump to..."? My initial thought is 'yes', since the area element implies a link to some other item or page location, but would like to hear what others think. If it helps at all, the page which prompted me to ask the question is this one: ...
2
3783
by: user | last post by:
Hi all... i am trying to print an image using GDI - but the only thing i get is a black rectangle. Does anybody know what is wrong, or how else to get the bitmap on the printer (GDI+ is not possible. it is a POS printer (for restaurants) and the printer internal fonts are a MUST for printing speed. as far as i know printer internal fonts are only accessable through GDI, so all my printing is GDI up to now)
0
8996
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9566
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9388
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9333
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6800
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4608
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3319
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 we have to send another system
3
2217
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.