473,394 Members | 2,090 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

How do i open files as thumbnails in listview?

hi I am a beginner in C# programming
can someone pleas help me with this

I am creating an application in c# with vs and I want to open image selected in openfiledialog as thumbnails in a list view from the open file dialog but i don`t know where to begin can someone pleas help me.
Mar 9 '09 #1
6 4703
nukefusion
221 Expert 100+
Hi and welcome to the forums.

How about the help files? MSDN?

Resources for learning C#
OpenFileDialog
ListView
Mar 9 '09 #2
I went trough them but i can find any thing that can help me
Mar 9 '09 #3
nukefusion
221 Expert 100+
The links I posted contain plenty of resources for learning and all the information you would need to implement what you require. Is there a specific problem within the implementation that you are having?
Mar 9 '09 #4
Plater
7,872 Expert 4TB
Sounds like you need to learn the following:
Using the OpenFileDialog
Opening a file (either as a file, or using the Bitmap/Image .FromFile() function)
Create a thumbnail from an Image object
Use images in listviews

Start learning each of those items and you'll be able to put them together yourself.
Mar 9 '09 #5
HI thanks nukefusion this is Wat i got But i Don`t know how to get the
listview to show the files/open them.
Expand|Select|Wrap|Line Numbers
  1. OpenFileDialog MyDialog = new OpenFileDialog();
  2.             MyDialog.Multiselect = true;
  3.             MyDialog.Filter = "JPEG files (*.jpg)|*.jpg|All files (*.*)|*.*";
  4.             MyDialog.RestoreDirectory = true;
  5.             MyDialog.Title = "Add Files";
  6.  
  7.  
  8.  
  9.             Stream myStream = null;
  10.  
  11.             if (MyDialog.ShowDialog() == DialogResult.OK)
  12.             {
  13.                 try
  14.                 {
  15.                     if ((myStream = MyDialog.OpenFile()) != null)
  16.                     {
  17.                         using (myStream)
  18.                         {
  19.                             // listView1.??????????????????????? 
  20.                         }
  21.                     }
  22.                 }
  23.                 catch (Exception ex)
  24.                 {
  25.                     MessageBox.Show("Error: Could not read file from disk. Original error: " + ex.Message);
  26.                 }
  27.             }
  28.  
I also tried getting the directory and then use it in the picbox image location
it worked but its mad because you have to get all the directories of the files you selected and then use it in the picbox.And if you select to many or to few you get an error. saying Value out side array.
Mar 10 '09 #6
Plater
7,872 Expert 4TB
I would use the ImageFromFile() function on the Bitmap class to open the jpeg files.
Then make a copy of the object
Then close the original object (releases the file)
Then assign it to the listview
Mar 10 '09 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Wim | last post by:
I'm trying to add files with a OpenFileDialog to a listview. This is what I've come up with sofar: protected void ButAddClick(object sender, System.EventArgs e) { OpenFileDialog MyDialog = new...
2
by: Ada | last post by:
if you go to Windows Explorer and select a directory that contained a bunch of images, then go to VIEW > THUMBNAILS you will see a thumbnails of all the images in the folder. to familiarize...
3
by: Vagabond Software | last post by:
I'm trying to display thumbnail images in a Listview that look more like the Windows thumbnail view. Everything is working pretty good, but my thumbnails are decidedly not like the Windows...
3
by: WStoreyII | last post by:
i need a control (free) that can be used to display thumbnails of pictures like they are in explorer. What control can do this? Thanks WStoreyII
6
by: mike w. | last post by:
I want to create an application using VB.Net to have something like windows explorer to view thumbnails of image files in the directories. Is there a control or soemthing to do this? thanks ...
1
by: mark2802 | last post by:
Im using the CommonDialog activeX control to select multiple file names. However I would like to be able to control using code the resulting view of the files as you can do in realtime using the view...
8
by: Arno R | last post by:
Hi all. When I need to search for pictures, I always have too choose thumbnail-view manually. Is it possible to open the common dialog in thumbnail-view programmatically? Example ?? At the...
0
by: =?Utf-8?B?QWxoYW1icmEgRWlkb3MgS2lxdWVuZXQ=?= | last post by:
Hi misters, I have an WinForms application, and I am currently trying to load a TIFF file that contains about 70, 90 o more frames and show it in my form like thumbnails. Once I have the...
6
by: mistral | last post by:
what is correct way open a PDF document in new window use hyperlink? I want show images thumbnails linked with PDF files, when click on thumbnail, PDF will be opened in new window. Some of PDF...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.