|
|
#1 |
|
l33t!
Join Date: Sep 01
Posts: 4,428
![]() ![]() ![]() ![]() |
JPEG Compression -> save JPEG images with any quality
(VB version of this article is here )
Here's the code! Too many people ask for this ![]() Using this code you can save an image (System.Drawing.Image) item as a jpeg image, specifying the quality of it. Jpeg quality is the same as compression so the lower the quality, the smaller the file size. It's simple to use, ie just do this: PHP Code:
PHP Code:
hope it's helpful
__________________
rate my posts if they help ya! Extract thumbnail without reading the whole image file: (C# - VB) Apply texture to bitmaps: (C# - VB) Extended console library: (VB) Save JPEG with a certain quality (image compression): (C# - VB ) VB.NET to C# conversion tips!! Last edited by MrPolite; Jun 5th, 2005 at 05:44 PM. |
|
|
|
|
|
#2 |
|
New Member
Join Date: Oct 05
Location: Germany
Posts: 1
![]() |
Re: JPEG Compression -> save JPEG images with any quality
Hi,
a small problem is though, that you should use long as quality, not int. Anyway that's the only way I got it to work, got an error the way you used it... For EncoderParameter qualityParam = new EncoderParameter (Encoder.Quality, quality); quality can be something like 50L, or casting: (long)50, or you could use (long)quality, should also work... for me that does the trick anyway |
|
|
|
![]() |
|
||||||
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|