C# 클래스 NContrib.Drawing.Extensions.ImageExtensions

파일 보기 프로젝트 열기: veracross/ncontrib

공개 메소드들

메소드 설명
GetScaledImage ( this source, Size size ) : Image

Scales an image to within the specified dimensions, disregarding aspect ratio. To preserve aspect ratio, generate the size parameter using the Constrain, Scale, and Expand methods

GetScaledImage ( this source, int width, int height ) : Image

Scales an image to within the specified dimensions, disregarding aspect ratio

GetSquareImage ( this image ) : Image

Crops an image to make it square

SaveJpegWithCompressionSetting ( this img, Stream outputStream, long compression ) : void

Saves an Image as a JPEG to the given stream using a 1 - 100 compression level

SaveJpegWithCompressionSetting ( this img, string fileName, int compression ) : void

Saves an Image as a JPEG image to the given path using a 1 - 100 compression level

비공개 메소드들

메소드 설명
SetGraphicsDefaults ( this g ) : void

메소드 상세

GetScaledImage() 공개 정적인 메소드

Scales an image to within the specified dimensions, disregarding aspect ratio. To preserve aspect ratio, generate the size parameter using the Constrain, Scale, and Expand methods
public static GetScaledImage ( this source, Size size ) : Image
source this
size System.Drawing.Size New size to scale to. Consider using the Constrain, Scale, and Expand methods to generate this value
리턴 System.Drawing.Image

GetScaledImage() 공개 정적인 메소드

Scales an image to within the specified dimensions, disregarding aspect ratio
public static GetScaledImage ( this source, int width, int height ) : Image
source this
width int
height int
리턴 System.Drawing.Image

GetSquareImage() 공개 정적인 메소드

Crops an image to make it square
public static GetSquareImage ( this image ) : Image
image this
리턴 System.Drawing.Image

SaveJpegWithCompressionSetting() 공개 정적인 메소드

Saves an Image as a JPEG to the given stream using a 1 - 100 compression level
public static SaveJpegWithCompressionSetting ( this img, Stream outputStream, long compression ) : void
img this
outputStream System.IO.Stream
compression long
리턴 void

SaveJpegWithCompressionSetting() 공개 정적인 메소드

Saves an Image as a JPEG image to the given path using a 1 - 100 compression level
public static SaveJpegWithCompressionSetting ( this img, string fileName, int compression ) : void
img this
fileName string
compression int
리턴 void