# Help with displaying select parts of a tiled image

Page 1 of 1

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

### #1 Nolan_

Reputation: 0
• 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

• 痛覚残留

Reputation: 3987
• Posts: 12,337
• 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.