C# Класс Imazen.LightResize.SinglePurposeResize

This implementation of image resizing sacrifices 30-50% performance for simplicty. It only supports max-constraints resizing, jpeg encoding, and stream->stream processing.
Показать файл Открыть проект

Открытые методы

Метод Описание
Resize ( Stream s, Stream target, int maxwidth, int maxheight, int jpegQuality = 90 ) : void

Less efficient than LightResize, and cannot resize files in place. Caller MUST ensure the first stream is disposed if the second stream fails to open. I.e, place first stream in using(){} clause, and open the second stream inside it before calling Resize()

Приватные методы

Метод Описание
RenderAndEncode ( Bitmap b, Size targetSize, Stream target, int jpegQuality ) : void

Resizes the provided bitmap to the given target size and writes it to the target stream with jpeg encoding. Warning: Does NOT dispose the source bitmap, source stream, or target stream!

Описание методов

Resize() публичный статический Метод

Less efficient than LightResize, and cannot resize files in place. Caller MUST ensure the first stream is disposed if the second stream fails to open. I.e, place first stream in using(){} clause, and open the second stream inside it before calling Resize()
public static Resize ( Stream s, Stream target, int maxwidth, int maxheight, int jpegQuality = 90 ) : void
s Stream
target Stream
maxwidth int
maxheight int
jpegQuality int
Результат void