Anyone know of a work around in .Net to retain the highest possible resolution of a photo or image after compression or resizing?
rickvidallon
0
Light Poster
Recommended Answers
Jump to PostUse this code:
Dim g As Graphics = Graphics.FromImage(YourBitmap) g.SmoothingMode = SmoothingMode.HighQuality g.InterpolationMode = InterpolationMode.HighQualityBicubic g.PixelOffsetMode = PixelOffsetMode.HighQuality
And when saving use this:
Dim myParams As EncoderParameters = New EncoderParameters(1) myParams.Param(0) = New EncoderParameter(System.Drawing.Imaging.Encoder.Quality, 80) YourBitmap.Save(YourPath, GetEncoderInfo(MimeType), myParams)
This is GetEncoderInfo function:
All 4 Replies
ManicCW
3
Junior Poster in Training
rickvidallon
0
Light Poster
rickvidallon
0
Light Poster
ManicCW
3
Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.