4 Replies - 1316 Views - Last Post: 19 November 2012 - 05:31 PM Rate Topic: -----

#1 C#Guy  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 21-February 12

Saving images with actual size using ListBox.

Posted 18 November 2012 - 10:17 PM

Hi everybody,

When I save images using ListView, the images get smaller than the actual size. Can you please tell me how to avoid this? Here's the code I use
int i = 1;
        foreach (Image image in lvPtMedicalRecord.LargeImageList.Images)
        {
            string filename = @"filepath" + i.ToString() + ".jpg";
            lblFilePath.Text = filename;
            image.Save(filename, ImageFormat.Jpeg);
            i++;
        }



Is This A Good Question/Topic? 0
  • +

Replies To: Saving images with actual size using ListBox.

#2 Momerath  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1010
  • View blog
  • Posts: 2,444
  • Joined: 04-October 09

Re: Saving images with actual size using ListBox.

Posted 18 November 2012 - 10:47 PM

Do you mean that the dimensions get smaller or that the file size gets smaller? Are you saving them with the same DPI as the original?
Was This Post Helpful? 0
  • +
  • -

#3 C#Guy  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 21-February 12

Re: Saving images with actual size using ListBox.

Posted 18 November 2012 - 10:57 PM

The file size gets smaller. First I load images into ListView and then save it. The original images are quite large. But the file size of the images I saved get smaller. I had no idea how to solve this. Please help me.
Was This Post Helpful? 0
  • +
  • -

#4 Momerath  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1010
  • View blog
  • Posts: 2,444
  • Joined: 04-October 09

Re: Saving images with actual size using ListBox.

Posted 19 November 2012 - 12:25 AM

Stop using jpg to save the images, it's a lossy format that reduces the file size. On purpose.

You may want to take a look at this, which allows you to specify parameters to the encoder.

This post has been edited by Momerath: 19 November 2012 - 12:29 AM

Was This Post Helpful? 1
  • +
  • -

#5 tlhIn`toq  Icon User is online

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5464
  • View blog
  • Posts: 11,740
  • Joined: 02-June 10

Re: Saving images with actual size using ListBox.

Posted 19 November 2012 - 05:31 PM

One trick, odd as it is, is to rotate the image then rotate it back before saving. For whatever reason it stops the file save from re-compressing the data.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1