开发者

How to encode and decode a jpeg file?

开发者 https://www.devze.com 2023-02-13 10:33 出处:网络
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.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号