D
dgk
I have an app that has many subdirectories containing one or more
images (jpg, gif, bmp). When the user selects a directory, my plan is
to show the images if there are only one or two, or show thumbnails if
there are more and allow the user to click on each thumbnail to view
it full size.
Right now I'm just sticking an <IMG> tag for each image into a literal
control. It works fine but the images are huge which surprised me. I
really don't know the size of the image in order to specify height and
width in the IMG tag. I tried loading them and checking the
image.height and width but, after around 6 or 7 it runs out of memory.
Very weird. I am disposing the image after each one is loaded.
But that approach is very wasteful anyway. There can't be a need to
load each image just to get the browser to display it at the proper
size. Should I try adding image controls dynamically instead of
spitting out html? Am I missing the point entirely?
The thumbnail idea also presents the same problem. It seems wasteful
to load an image and generate the thumbnail in memory each time. I
guess I can check to see if the thumbnails exist and if not create
them. That way I only do it once or can even have a separate app do it
"offline".
Any image assistance appreciated.
images (jpg, gif, bmp). When the user selects a directory, my plan is
to show the images if there are only one or two, or show thumbnails if
there are more and allow the user to click on each thumbnail to view
it full size.
Right now I'm just sticking an <IMG> tag for each image into a literal
control. It works fine but the images are huge which surprised me. I
really don't know the size of the image in order to specify height and
width in the IMG tag. I tried loading them and checking the
image.height and width but, after around 6 or 7 it runs out of memory.
Very weird. I am disposing the image after each one is loaded.
But that approach is very wasteful anyway. There can't be a need to
load each image just to get the browser to display it at the proper
size. Should I try adding image controls dynamically instead of
spitting out html? Am I missing the point entirely?
The thumbnail idea also presents the same problem. It seems wasteful
to load an image and generate the thumbnail in memory each time. I
guess I can check to see if the thumbnails exist and if not create
them. That way I only do it once or can even have a separate app do it
"offline".
Any image assistance appreciated.