First of all Im new to this forum and this is my first post. And Id like to thank you all in advance.
Sirs, here's the problem:
how can I translate/convert the matrix on the fly or suntime (see attached file name matrix..jpg) to generate a dynamic table with image related to the ids (please see attached file named converted..jpg). The matrix can be in any configuration.
This challenge is really giving me a headache:confused: . Maybe you guys could share an advice or snippets of code on how to do this in asp or javascript.
Im a beginner programmer in asp but i have the zeal to learn more.
Thanks to you guys and experts again.
from fellow webdev to webdev:)
jerry
harumph
10-24-2007, 09:32 AM
How are you getting this data? A database? Do these images combined need to always create a square? The same Id = the same image repeated, or if Ids are the same, it means the combined size = one image?
jerrym
10-25-2007, 09:44 AM
How are you getting this data? A database? Do these images combined need to always create a square? The same Id = the same image repeated, or if Ids are the same, it means the combined size = one image?
harumph
How are you getting this data? A database?
First ,the data more likely be set by a user using a check box per square. Then all related square/s must be linked to an id (or image-id) and stored in a db or file.
For example (5 X 5):
Square # reference-
1, 2, 3, 4, 5
6, 7, 8, 9, 10
.............
21, 22, 23, 24, 25
Square 1 and 6 are related. Now square 1 n 6 must be linked to id=001.
Square 1 n 6 will be treated as ONE (1) image when displayed (a vertical rectangle) in a table.
Do these images combined need to always create a square? The same Id = the same image repeated, or if Ids are the same, it means the combined size = one image?
Yes, the combined square/s that a particular id occupies is treated as ONE image. NOT repeated. Ex. square 1 n 6 = 1 image; square 4 n 6 = 1 image:
The html will somewhat look like the one below when the squares are translated to a table.
===========================
<table>
<tr>
<td rowspan="2">Image-id-001.jpg</td><td>Image-id-002.jpg</td><td>Image-id-003.jpg</td><td colspan="2">Image-id-004.jpg</td>
....
</table>
============================
As an analogy, its like dividing a parcel of land in many countless ways using a matrix/squares with checkboxes or otherwise, then after a PROCESS will produce a table according to your partition.
Its sounds crazy, right?:confused: .I hope not. :o Like what a mentioned its giving a headache. I hope this problem won't give you any.
Thanks for your reply.
Rodel
harumph
10-25-2007, 10:55 AM
You've got your work cut out for you. It's doable, but time-consuming.
I'd set up case statements. Probably best to set up arrays. Look up "multi-dimensional arrays."
Are you going to force the sizes of these images? How will they know to use one cell or 4?
jerrym
10-25-2007, 06:28 PM
Are you going to force the sizes of these images? How will they know to use one cell or 4?
The the images are resized already.
The user determines the number of squares/boxes based on the size of image (say two (2) squares vertical, or two (2) horizontal AND two (2) vertical etc.) he wants to display.
harumph
10-26-2007, 07:55 AM
What is the largest size image? 4 blocks square? 3 blocks long? Can one take up the whole grid?
You know, Flash has a drag-n-drop process that's pretty sweet that you can also build in a snap-to process. Then that data can be passed back to the page/database. Just a thought.
harumph
10-26-2007, 10:58 AM
Not sure if this will work or not. There are a lot of scenarios you'd have to cover.
There has to be an easier way to do this thing. Sometimes I can't see the forest for the trees.
mattyblah
10-30-2007, 11:04 PM
It's doable, but more as a challenge. Even still, what able "L" shapes, which aren't necessarily doable in html with tables? perhaps just matching background colors might make it easier.
harumph
10-31-2007, 08:22 AM
Matty, looks like he's gonna try this route. (http://www.dhtmlgoodies.com/scripts/arrange-nodes-2/arrange-nodes-2.html) Pretty elegant solution. Yea, L shapes would be tricky any way you look at it.
Tables are a pain to work with, anyway.
webdeveloper.com
Copyright Internet.com Inc., All Rights Reserved.