Thread: Image Question

    #1
  1. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Jan 2005
    Location
    Ireland
    Posts
    25
    Rep Power
    0

    Image Question


    I have a very simple image basically a box with four colour coded sections - for underweight, healthy weight etc - is it possible to put a line through the image based on where the current users weight falls? or an X or some kind of marker?

    Thanks all
  2. #2
  3. Contributing User
    ASP Genius (4000 - 4499 posts)

    Join Date
    Jun 2004
    Location
    Somewhere only we know...
    Posts
    4,230
    Rep Power
    1499
    Depends how many different positions are possible.

    To do it simply, I'd create a table with however many rows and columns you need (say 2x2) and use the image as the background to the table. You can then write over the top of the image with a mark in whichever cell of the table you want.

    Code:
     
    <table background="image.jpg" border="1" cellpadding="0" cellspacing="0">
    <tr> 
    <td valign="middle" align="center"><% if variable="underweight" then response.write("X")%></td>
    <td valign="middle" align="center"><% if variable="healthyweight" then response.write("X")%></td>
    </tr>
    <tr>
    <td valign="middle" align="center"><% if variable="overweight" then response.write("X")%></td>
    <td valign="middle" align="center"><% if variable="correctweight" then response.write("X")%></td>
    </tr>
    </table>
  4. #3
  5. Senior Water Wizard
    ASP Mastermind (5000+ posts)

    Join Date
    Aug 2004
    Location
    Cape Town, RSA
    Posts
    10,233
    Rep Power
    863
    Hi,

    I am not sure how to do that but,
    here is another sample that will do the trick

    Code:
      <table border="1" width="40">
        <tr>
      	<td>
      <%
      if rs("weight") > 80 then
      response.write("X")
      else
      response.write("&nbsp;")
     end if
      %>
      </td>
      	<td bgcolor="#FF0000">&nbsp;</td>
        </tr>
        <tr>
      	<td>
      <%
      if rs("weight") > 60 AND rs("wight") <80 then
      response.write("X")
      else
      response.write("&nbsp;")
     end if
      %>
      </td>
      	<td bgcolor="#FFFF00">&nbsp;</td>
        </tr>
        <tr>
      	<td>&nbsp;</td>
      	<td bgcolor="#00FFFF">&nbsp;</td>
        </tr>
        <tr>
      	<td>&nbsp;</td>
      	<td bgcolor="#00FF00">&nbsp;</td>
        </tr>
      </table>
    its uses a table with 4 colored cell's and creates an X next to the cell where with the appropaite weight.

    hope it helps
    Last edited by nofriends; February 22nd, 2005 at 06:06 AM.
    Look! Its a ShemZilla


  6. #4
  7. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Jan 2005
    Location
    Ireland
    Posts
    25
    Rep Power
    0
    Thanks guys! So simple
  8. #5
  9. The Laughing Moderator
    ASP Scholar (3000 - 3499 posts)

    Join Date
    Apr 2004
    Location
    Sydney, Australia
    Posts
    3,268
    Rep Power
    45
    There are proprietary image packages that can do this for you on the fly.

    If you have a mind to, and can get the maths right, you can use css divs and absolute positioning to place the image in a fixed position, and layer a line image over it a position relative to the top/bottom of the image. A very simple example shown below:
    Code:
    <html>
    <head>
    <style>
    img {
     position: absolute;
     top: 100px;
     left: 100px;
     border: 1px solid #000;
     width: 100px;
     height: 100px;
     z-index: 0;
    }
    hr {
     position: absolute;
     top: 120px; /* change this figure to change vertical position */
     left: 100px;
     width: 100px;
     border: 1px solid #ff6600;
     margin: 0;
     z-index: 1;
    }
    </style>
    </head>
    <body>
    <img src="#" />
    <hr />
    </body>
    </html>
  10. #6
  11. Senior Water Wizard
    ASP Mastermind (5000+ posts)

    Join Date
    Aug 2004
    Location
    Cape Town, RSA
    Posts
    10,233
    Rep Power
    863
    Originally Posted by badprogrammer
    Thanks guys! So simple
    no problem
  12. #7
  13. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Jan 2005
    Location
    Ireland
    Posts
    25
    Rep Power
    0
    thanks lafinboy - due to time constraints I am going with the easy solution for now, if I have a chance at the end I'll try your suggestion

Similar Threads

  1. vb: image resizing from stream to SQL Server
    By timandkids in forum .NET Development
    Replies: 0
    Last Post: November 10th, 2004, 12:54 PM
  2. Displaying alternate image when image source not found
    By Kate Perry in forum ASP Development
    Replies: 9
    Last Post: August 17th, 2004, 10:14 AM
  3. Any way to read image dimensions?
    By peoplayer in forum ASP Development
    Replies: 1
    Last Post: April 23rd, 2004, 11:21 AM
  4. Problem displaying image from Access in table
    By FDisk in forum .NET Development
    Replies: 2
    Last Post: April 18th, 2004, 01:44 AM
  5. Image Question
    By Sherrie in forum Microsoft Access Help
    Replies: 6
    Last Post: April 2nd, 2004, 12:26 AM

IMN logo majestic logo threadwatch logo seochat tools logo