locked
Change Image DPI RRS feed

  • Question

  • I have a 96 DPI BitmapFrame.  I am saving it to a JPEG file using the JpegBitmapEncoder.  Is there a way to change the DPI when saving?  For example, could I save it to a 150 DPI JPEG?
    Friday, August 15, 2008 3:56 PM

Answers

  • Marco Zhou said:

    I think you could create a destination bitmap given the specified DPI values using BitmapSoure.Create() method, and then you could copy the pixels from the 96 DPI bitmap to this destination bitmap, and then using proper encoder to encode it into the required format.

    Hope this helps



    Thank you for your reply, but I am working with large images and the copy method is very slow.  I decided to use TIFF, because the DPI can be changed quickly in the metadata.
    • Marked as answer by Marco Zhou Friday, August 22, 2008 2:42 AM
    Thursday, August 21, 2008 4:39 PM

All replies

  • I think you could create a destination bitmap given the specified DPI values using BitmapSoure.Create() method, and then you could copy the pixels from the 96 DPI bitmap to this destination bitmap, and then using proper encoder to encode it into the required format.

    Hope this helps
    Wednesday, August 20, 2008 9:08 AM
  • Marco Zhou said:

    I think you could create a destination bitmap given the specified DPI values using BitmapSoure.Create() method, and then you could copy the pixels from the 96 DPI bitmap to this destination bitmap, and then using proper encoder to encode it into the required format.

    Hope this helps



    Thank you for your reply, but I am working with large images and the copy method is very slow.  I decided to use TIFF, because the DPI can be changed quickly in the metadata.
    • Marked as answer by Marco Zhou Friday, August 22, 2008 2:42 AM
    Thursday, August 21, 2008 4:39 PM