Results 1 to 6 of 6

Thread: Converting BMP to JPG loses quality

Threaded View

  1. #3

    Thread Starter
    Addicted Member WALDO's Avatar
    Join Date
    Aug 2002
    Location
    Swing of Prussia, PA
    Posts
    244

    Talking Cander, you rock!

    You truly are the master of the DUH.
    I'm going to try some of this code today.

    It looks like this is the part I should be focusing on:
    VB Code:
    1. ' Get an array of ImageEncoders..array item 1 is Jpeg.
    2. Dim imgCodecs() As ImageCodecInfo  = ImageCodecInfo.GetImageEncoders()
    3.    
    4. ' Set quality Parameter for the Jpeg codec
    5. Dim imgParams As EncoderParameters = New EncoderParameters(1)
    6. Dim imgQuality As EncoderParameter = New EncoderParameter(System.Drawing.Imaging.Encoder.Quality, 80)
    7. ' Set quality
    8. imgParams.Param(0) = imgQuality
    9.      
    10. ' Render BitMap Stream Back To Client
    11. newBitmap.Save(Response.OutputStream,imgCodecs(1), imgParams)
    Is that right?
    Last edited by WALDO; Dec 13th, 2002 at 10:16 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width