-
Jan 4th, 2013, 01:13 AM
#1
Thread Starter
Member
(ask) picture album like windows explorer
how create photo album, i wonder to create like windows explorer with thumbnail folder (as category) when i perform click the show all my picture inside folder and show the name without extension just filename, i just try it with listview.. can anyone help me to figure this out..
Last edited by primadona; Jan 4th, 2013 at 01:22 AM.
-
Jan 4th, 2013, 01:27 AM
#2
Re: (ask) picture album like windows explorer
Thumbnails are easy to create with the Image.GetThumbnailImage method. Creating that 3D folder effect is something that I would not suggest trying in Windows Forms. If you want to do that sort of thing then you should use WPF from the get-go. WPF has a steep learning curve but, once you're comfortable with it, effects like that are relatively simple.
-
Jan 4th, 2013, 01:35 AM
#3
Thread Starter
Member
Re: (ask) picture album like windows explorer
Originally Posted by jmcilhinney
Thumbnails are easy to create with the Image.GetThumbnailImage method. Creating that 3D folder effect is something that I would not suggest trying in Windows Forms. If you want to do that sort of thing then you should use WPF from the get-go. WPF has a steep learning curve but, once you're comfortable with it, effects like that are relatively simple.
hi jmcilhinney
i just want create 1 photo as thumbnail so i dont need 3d, how to do that on vb?
and the folder directory start with c:\photo will load all directory sub folder ex:
c:\photo\vacation\ <-- when thumbnail click will load all image in news folder
c:\photo\holiday\ <-- when thumbnail click will load all image in news folder
c:\photo\news\ <-- when thumbnail click will load all image in news folder
and etc
any possible to do that ?
-
Jan 4th, 2013, 03:35 AM
#4
Thread Starter
Member
Re: (ask) picture album like windows explorer
Code:
For Each i As String In Directory.GetFiles("C:\")
ListView1.Items.Add(Path.GetFileName(i)) 'the Path is a separate class of the System.IO Namespace that allows you to perform operations based on path information - such as GetFileName
Next
why only files show up, how to make the folder show up in listview?
-
Jan 4th, 2013, 03:50 AM
#5
Re: (ask) picture album like windows explorer
Um, you're calling GetFiles, so why would you expect to get anything besides files? If the Directory class has a GetFiles method to get files, don't you think that it should be fairly easy to answer your own question with a little bit of logic?
-
Jan 4th, 2013, 04:11 AM
#6
Thread Starter
Member
Re: (ask) picture album like windows explorer
Originally Posted by jmcilhinney
Um, you're calling GetFiles, so why would you expect to get anything besides files? If the Directory class has a GetFiles method to get files, don't you think that it should be fairly easy to answer your own question with a little bit of logic?
oh thank's for your correction;
change with ;
Code:
Directory.GetDirectories
can i load the thumbnail from random image inside the folder?
idk why i'm very confuse with this project...
-
Jan 4th, 2013, 04:51 AM
#7
Re: (ask) picture album like windows explorer
Using purely managed code, to create a thumbnail, you must first load the file into an Image object and then call GetThumbnailImage. If you want a random file then you call GetFiles and choose a random element from that array.
-
Jan 4th, 2013, 05:34 AM
#8
Thread Starter
Member
Re: (ask) picture album like windows explorer
Originally Posted by jmcilhinney
Using purely managed code, to create a thumbnail, you must first load the file into an Image object and then call GetThumbnailImage. If you want a random file then you call GetFiles and choose a random element from that array.
can you give me sample code?
-
Jan 4th, 2013, 05:38 AM
#9
Thread Starter
Member
Re: (ask) picture album like windows explorer
i'm try with code like this, but the thumbnail still not appear
Code:
For Each f As String In System.IO.Directory.GetFiles("C:\", "*.jpg")
Dim img As Image = New Bitmap(f)
ImageList1.Images.Add(img.GetThumbnailImage(96, 96, Nothing, Nothing))
ListView1.Items.Add(f, ImageList1.Images.Count - 1)
img.Dispose()
Next
-
Jan 4th, 2013, 04:18 PM
#10
Re: (ask) picture album like windows explorer
Have you set ListView1.LargeImageList = ImageList1 (in design or runtime)?
As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"
Reviews: "dunfiddlin likes his DataTables" - jmcilhinney
Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!
-
Jan 6th, 2013, 11:37 PM
#11
Thread Starter
Member
Re: (ask) picture album like windows explorer
Originally Posted by dunfiddlin
Have you set ListView1.LargeImageList = ImageList1 (in design or runtime)?
in design
when i run my form, the listview just show directory name and blank imagelist
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
|