Click here to Skip to main content
15,742,655 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am using listview with images to display images, now i want to trackbar to increase or reduce the size of images in listview,

private void trackBar1_Scroll(object sender, EventArgs e)

      private void setZoom()
          int newZoom = zoomFactor[zoomBar.Value];
          imageList1.ImageSize = new System.Drawing.Size(newZoom, newZoom);

          listView1.LargeImageList = imageList1;


i m using this for increasing the size of image
its work but the thumbnail get changes.
Updated 26-Jan-12 18:19pm
Erik Rude 26-Jan-12 7:20am    
Help yourself by stating whether this is WinForms or WPF or something else.
Sumit Memane 26-Jan-12 7:22am    
Sergey Alexandrovich Kryukov 26-Jan-12 14:20pm    
Please tag it. You are the one who is the most interested in that. Use "Improve question".

You can have an image which is big enough (in pixels) and scale it down to required size. This is not a trivial procedure called re-sampling.

This is the recipe on how to do it:[^].

Generally, you can re-sample the image with decent quality if you scale it down, not up. I would recommend you to avoid the possibility of scaling it up; or allow some re-sampling up, not very moderate, otherwise it will look really ugly.

Share this answer
Espen Harlinn 26-Jan-12 17:13pm    
Sergey Alexandrovich Kryukov 26-Jan-12 17:18pm    
Thank you, Espen.
Sumit Memane 27-Jan-12 3:56am    
bt i want to do it using listview and trackbar
Can you help me write the function zoomFactor?
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900