I've been thinking about setting up a image grid similar to milliondollarhomepage for a small domestic hobby idea , it would be dynamic. The grid would be around 500x500, I am wondering the best way to code this up, It can't be slow.
I am thinking it will work like this:
- Users choose their place on the grid and upload their image.
- The image is stored in the DB in a image type column
- On rendering the page to the public,
.NET
cycles through all the uploaded images from the DB and dynamically creates the image based on each DB rows data & stored place in the square
The thin开发者_运维技巧g is I am not sure if this is a silly way to do it?
What do you guys think?
Thanks!
You're better off just recreating the image whenever somebody uploads a change. Assuming there will be far more visitors than contributors it would be wasteful to recreate the image for every request.
Your approach sounds pretty reasonable to me.
Like Gordy said; you probably don't want to regenerate the image on each visit - but your code to generate the image and save it to the file system would be largely the same anyway. Then, you can use a large HTML Map to define the individual ad's 'area'. That will let you have different mouse-over text and URL when clicked.
Again, I'd be tempted to just generate the HTML file whenever you have a new client come on. I mean, update your database and use .NET code to generate the HTML. But the static html page with a static image is going to be a lot more performant than building anything dynamically.
精彩评论