1 Replies - 1339 Views - Last Post: 28 November 2012 - 11:23 PM

#1 Nolan_  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 13-June 12

Help with displaying select parts of a tiled image

Posted 28 November 2012 - 07:47 PM

Here's the deal:
I have an image I've sliced into many rows and columns, let's say 20 rows and 26 columns.
Each sliced piece has a number assigned to it, 01.jpg through 520.jpg

I have a database that stores numbers, let's say some numbers are: 1,52,189,264,389,502

I would like to ONLY show the pieces that correspond to the numbers in the database, in their CORRECT position, not just show 6 pieces.

I can figure out WHERE to put each piece using an algorithm like this:
Let's use piece number 189 as an example:
Dim PieceNum, RowNum, ColNum
PieceNum=189
RowNum = Cint(PieceNum / 26) +1 ---- (189/26=7.26)--> Cint(7.26)=7 7+1=8 ' ROW 8!
ColNum = PieceNum - (Cint(PieceNum / 26) * 26) ---- 189 - (7 * 26 (182)) = 7 ' COLUMN 7!

So... with the above I can determine that piece 189.jpg should go in Column 7 of Row 8, but HOW would I do that using either an HTML table, or DIV?

Alternatively, is there a way to stitch these together on the fly before sending out a single image?

Thanks!

Is This A Good Question/Topic? 0
  • +

Replies To: Help with displaying select parts of a tiled image

#2 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3515
  • View blog
  • Posts: 10,141
  • Joined: 08-June 10

Re: Help with displaying select parts of a tiled image

Posted 28 November 2012 - 11:23 PM

you could use CSS image sprites to show only the parts of the image you want.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1