How to encode and decode a jpeg file?
i want to encode and deco开发者_StackOverflow社区de a jpg file in a windows app with C#.
How can I do it this?
System.Drawing.Bitmap will load and save JPG files.
If you're using WPF, you can use the JpegBitmapEncoder and JpegBitmapDecoder classes to encode and decode JPG files.
Use the System.Drawing.Bitmap
class. It can read and write JPEG, PNG and BMP files.
What exactly do you mean by encode/decode? If you have the pixels you could just use the Bitmap
class, which supports both BMP and JPEG.
Note that you will have to add a reference to System.Drawing
to your project to use Bitmap
.
精彩评论