C# Class 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.
Datei anzeigen Open project: imazen/lightresize

Public Methods

Method Description
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()

Private Methods

Method Description
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!

Method Details

Resize() public static method

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
return void