Placing a small image at a particular point of an

Results 1 to 2 of 2

Thread: Placing a small image at a particular point of an

  1. #1
    Chandra sekhara Rao Guest

    Default Placing a small image at a particular point of an

    Hi all,<BR> Here I have a small query about placing a small image(jpg)on a big jpg file by reading the coordinates dynamically from the datbase using any web technollogy.<BR> Real problem is as follows....<BR> I have one html file with a image(jpg) on it.Before displying the html page with Image I have to read some points(coordiantes) from the database and I have to place a very small Image(small jpg) at each and every point.(I am taking care all map and area of the html page).<BR>Advaced Thanks for your valuable suggestions or sample code or an Idea or anything.<BR>Regards<BR>chandu(

  2. #2
    Join Date
    Dec 1969

    Default RE: Placing a small image at a particular point of

    Ok, this sounds quite complex, so I&#039;ll start with outlining what you&#039;ve written:<BR><BR>1) You have a large JPEG map which you&#039;re displaying on a page.<BR>2) Inside a database, you have sets of coordinates of points you want to reference on the map.<BR>3) You want to get these coordinates, and place a smaller JPEG at these coordinates, over the top of the map.<BR><BR>Ok, well this is getting complex. You may be able to get a third-party plug-in to do most of the hard work for you, but I&#039;m guessing that this is pretty specific, so it wouldn&#039;t exist...<BR><BR>Ok, this is how I would go about it. Bear in mind that the steps are few, but the implementation may take a while. This is DHTML territory, so remember cross-browser code is important.<BR><BR>1) Create an ASP page. Inside that page, create a division which contains the main map. Make it appear at (0,0). (Remember that co-ordinates in DHTML are from the top-left corner).<BR>2) Get the co-ordinates from the database, and for each set of coordinates, generate a division containing the smaller JPEG. Position this new division at the correct coordinates.<BR><BR>Ok, I won&#039;t go too much into this, but here&#039;s an example page. This will be IE4+ only, though.<BR><BR>==== START index.asp<BR>&#060;html&#062;<BR>&#060;head&#062;< BR>&#060;/head&#062;<BR>&#060;body&#062;<BR>&#060;div id="mainMap" style="position:absolute;top:0;left:0"&#062;&#060; img src="mainmap.jpg"&#062;&#060;/div&#062;<BR>&#060;%<BR>Set Connection = Server.CreateObject("ADODB.Connection")<BR>Set RecordSet = Server.CreateObject("ADODB.RecordSet")<BR>Connecti on.Open("DSN=whatever")<BR><BR>do while RecordSet.EOF = false<BR> %&#062;<BR>&#060;div style="position:absolute;top:&#060;%=RecordSet.Fie lds("top")%&#062;;left:&#060;%=RecordSet.Fields("l eft")%&#062;;"&#062;&#060;img src="smallimage.jpg"&#062;&#060;/div&#062;<BR> &#060;%<BR> RecordSet.MoveNext<BR>loop<BR>%&#062;<BR>==== END index.asp<BR><BR>That sound reasonable?<BR><BR>Craig.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts