|
-
Jul 17th, 2000, 02:12 PM
#1
Thread Starter
Addicted Member
Hi, I want to make an image browser, which allows you to view images in a selected directory as small thumbnails.
The thing is I have made a small test project that creates the thumbs. This project uses an image array to load the image boxes as required, but with this method I have not yet been able to design a way of showing the image proportionally in the thumb, instead it comes out stretched.
If I do the same thing with picture boxes I can make it work fine! but the only thing that bugs me is that if the selected directory has 100s or 1000s of pics the pictures boxes loaded will take up a lot of resources from the system(RAM Mainly).
What is the best way of constructing a thumbnail viewer?
Would it be better to draw the thumbnails in a picture box?
But this would mean a lot of code to check for which one was clicked and what about the label under each thumb?
Please Advise me!
Ram...Thanks in advance!!!
-
Jul 17th, 2000, 02:22 PM
#2
Hyperactive Member
Maybe a solution
Use the picture boxes however set it up where it only shows 10 per page if its < 10. This way it doesn't take up to much sources at once, and you can have a little arrow in the bottom to switch to the next page, while unloading the previous saving sources. Hope that helps!
-RaY
VB .Net 2010 (Ultimate)
-
Jul 18th, 2000, 12:18 PM
#3
Thread Starter
Addicted Member
Yeh that seems a good idea, but I realy want it to work like the comercial counterparts (ACDSee for example) this program some how seems to load them very quick I think it uses some method of caching.
Any further sugestions?
Thanks!!
-
Jul 18th, 2000, 12:55 PM
#4
Monday Morning Lunatic
AFAIK, the first time Paint Shop Pro reads a folder, it creates all the thumbnails and saves them into a file called pspbrowse.jbf. Next time round, it just loads the file, then a separate thread updates them while you look through the images. As a method it seems fine.
Second point - detecting clicks, divide the height of the PictureBox by the vertical number of thumbnails, then see how far down the mouse pointer offset is.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Jul 18th, 2000, 02:56 PM
#5
Thread Starter
Addicted Member
But Parksie won't that just create more and more files as you brose through many directories. What I understand from what you wrote is that every time a user open/selects a directory the program basically create a file containing the thumbs & displays that.
Now if I clicked another dir would this create another file and are the files ever deleted?
Is this similar to what you are trying to say? Or am I just holding the wrong end of the Broom stick.
-
Jul 18th, 2000, 06:59 PM
#6
Monday Morning Lunatic
I suppose it will make lots of files...however, from the user's point of view, if they need a browser, then they won't mind one more file which is THAT useful. Although, other methods could be used:
1. Use a cache file for only the last viewed folder, and keep it with the application, not the images
2. Make a folder for the cache files, and leave an option for the user so they can all be deleted.
3. Access databases anyone?
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Jul 19th, 2000, 03:15 PM
#7
Thread Starter
Addicted Member
Thanks for your reply's Parksie, and I do take your points into consideration.
Any ideas on How ACDSea32 displays its thumbs & full screen picture so quickly?
Is there an API that can display image preview/create small thumbs very quickly?
I have at times seen ACDSee draw the image in low res and then perform a second pass to sharpen it, perhaps this is the method? Any ideas to how this can be done in VB with or without APIs??
Thanks for your reply's
-
Jul 19th, 2000, 03:22 PM
#8
Thread Starter
Addicted Member
Is there a way to display the images using a custom dpi, I was thinking that is I could display the image at a dpi say of about 30-70dpi the thumbs may load quicker.
However would reading the original image file before creating the low res thumbs still take time?
If it doesn't effect the speed to much how can one achive displaying thumbs/images in a custom dpi using VB?
Any ideas people?
Thanks!!
-
Jul 19th, 2000, 03:32 PM
#9
Monday Morning Lunatic
ACDSee probably uses the "create thumbnails first, display fast later" method, which seems to be the most used. In this case, the low-res preview is a blown up version of the thumbnail (very quick to draw). It then loads and displays the full picture.
On to different resolutions...the problem here, is that few file types include DPI information! TIFF does, though. Screen resolution is supposedly 72dpi (a 72 point character should be an inch high), but it never is. A scanned image, if scanned at 300dpi, will simply have half the pixel sizes of a 600dpi picture. The only difference is when it's displayed. To display at a different size, simply change the size you interpolate through.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|