By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,737 Members | 1,270 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,737 IT Pros & Developers. It's quick & easy.

A big dynamic image grid

P: n/a
Not sure the best way to go about making this:

I have 3 user defineable values - Width, Height, and Size. These values
need to define a "grid" of some kind in the following manner: The Width is
how many columns the grid has; the Height indicates how many rows the grid
has, and the Size indicates both the Width and Height of each individual
unit, or cell, on the grid (all cells are to be square, n x n).

Each cell of the grid must be receptive to a drag & drop operation, be able
to display an image. Each cell of the grid needs to be somehow aware of
what picture it's holding so that it can write that information out to a
file later.

My initial attempt at this is quite the horrific and abysmal failure :) It
"works", but it is *laughably* inefficient. Thinking I was being somewhat
cleaver, I created a custom control that inherits from picturebox and taught
it to handle the drag/drop operations in the way I want & output it's
contents to the file. Next, I created another custom control that can be
fed the Width, Height & Size values, which then populates & resizes itself
accordingly, housing any given number of my custom picturebox controls to
create a "grid" of them as per the dimension settings. This control, in
turn, goes on a form where I can specify new dimensions for the grid and
drag & drop pictures into it's cells.

Unfotunately, at some point I'll need this grid to reach sizes of say, 10000
x 10000. Very soon this becomes an obviously unreasonable request upon my
poor little program. It takes it several seconds to render a grid even 100
x 100, let alone ten thousand. I didn't even bother to attempt making one
of that size. So I don't think my "cleaver" idea was very cleaver at all,
in hindsight.

What controls should I research (or make) to make this project a reality?
There is no database involved; but should I try tinkering with a datagrid,
or would that be more frustration than it's worth? Would I be better off
simply OwnerDrawing a single picture box and simulating the whole grid/cell
thing under the hood, relying on x,y coords of drag/drop operations,
indexing what was being displayed where, all the while allowing the thing to
be dynamically sized (that seems like a somewhat daunting task but I suppose
I could do it if I had to).
Nov 21 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.