locked
making maps from a database RRS feed

  • Question

  • User-2141902449 posted
    Hi, I'm making a map of my office building from a database. I have the map of the entire floor in gif format, and I have the people's names and room numbers in my sql db. I'm going to pull the names and room numbers from the db, then place the names on top of the gif. So if Steve is in 502, his name will be placed in that room on the map. So far, I did it with asp.net, and css stylesheets to place the names over the gif. What are your suggestions on the best way to do this? I need the map to be printable, so I'm a little worried that if i use straight asp.net, different browsers will might print differently.
    Tuesday, June 22, 2004 2:19 PM

All replies

  • User541108374 posted
    Hi, maybe this article can be of help to you: Dynamically Write Text On An Image. Grz, Kris.
    Tuesday, June 22, 2004 4:36 PM
  • User-1850826143 posted

    Can you make the text hot (clickable) at the same time?

    Ning

    Wednesday, August 3, 2005 6:18 PM
  • User541108374 posted
    Hi,

    not directly but it could be done probably by using a div and img tag. In the img you set the src attribute to the page that displays the picture. After that you can set set an anchor with a div in it and play around with css to se the div properly.

    Or even better: you can place the picture normally with html and only create the small part that you want to be clickable with the asp.net page in the img tag and place an anchor tag around it.

    Grz, Kris.
    Saturday, August 6, 2005 4:38 AM
  • User541108374 posted

    I recreated the sample code from codeproject and then made a whole new page. Now I used as a background (the first image) a wallpaper and then used the div tag with some css positioning to get it done:

    <html>
      <head>
        <title>Clickable watermark test</title>
      </head>
      <body>
        <img src="wallpaper_strawberry.jpg" width="1024" height="768">
        <div style=";width:160; height:50;left:100;top:250;border:0;"><a

    href="http://msdn.microsoft.com"><img src="watermark.aspx" width="600" height="309"></a></div>
      </body>
    </html>

    Of course you can change it the way you like. Another thing could be that you don't use a jpeg image as input of your asp.net code but create a gif image from scratch (or a png image) with everything aside the watermark itself set to transparent.

    Grz, Kris.

    Saturday, August 6, 2005 4:54 AM
  • User-1850826143 posted
    Thank you very much for your help. Following your example, I added an arry of HtmlAnchor controls in the code behind. In this way, I can easily generate the position values from a database for each anchor tag at run time so that I can align each clickable label correctly on the graph image. My only concern is that will the abolute positions hold across all browsers?

    Ning
    Wednesday, August 10, 2005 6:49 PM
  • User541108374 posted

    IE is one of the average learners in the classroom when it comes down to css. There are already a lot of so called "css hacks" for IE available and for different versions of IE. Other browsers tend to follow the W3C standards more closely. So if you design your site completely with CSS for marking up it's probably better to read some articles about it to know what will be the do's and dont's of CSS design.

    My experience is that if you don't go to fancy by using the latest cool stuff from CSS 2 then you're already pretty safe. The rest is experience and reading a lot about the subject.

    Grz, Kris.

    Thursday, August 11, 2005 2:12 PM