C# 클래스 CSharpImageLibrary.ImageEngineImage

Represents an image. Can use Windows codecs if available.
상속: IDisposable
파일 보기 프로젝트 열기: KFreon/CSharpImageLibrary 1 사용 예제들

공개 메소드들

메소드 설명
Dispose ( ) : void

Releases resources used by mipmap MemoryStreams.

GetWPFBitmap ( int maxDimension, bool ShowAlpha = false, int mipIndex ) : System.Windows.Media.Imaging.BitmapSource

Creates a WPF Bitmap from largest mipmap. Does NOT require that image remains alive.

ImageEngineImage ( MemoryStream stream, int maxDimension ) : CSharpImageLibrary.DDS

Creates an image supporting many formats including DDS.

ImageEngineImage ( MipMap mip ) : CSharpImageLibrary.DDS

Creates image from mipmap.

ImageEngineImage ( byte imageData, int maxDimension ) : CSharpImageLibrary.DDS

Creates an image supporting many formats including DDS.

ImageEngineImage ( string path, int maxDimension ) : CSharpImageLibrary.DDS

Creates an image supporting many formats including DDS.

Load ( Stream stream, int maxDimension ) : void
Resize ( double scale ) : void

Scales top mipmap and DESTROYS ALL OTHERS.

Resize ( int DesiredDimension ) : void

Resizes image. If single mip, scales to DesiredDimension. If multiple mips, finds closest mip and scales it (if required). DESTROYS ALL OTHER MIPS.

Save ( string destination, ImageEngineFormat format, MipHandling GenerateMips, int desiredMaxDimension, int mipToSave, bool removeAlpha = true, List customMasks = null ) : System.Threading.Tasks.Task

Saves image in specified format to file. If file exists, it will be overwritten.

Save ( ImageEngineFormat format, MipHandling GenerateMips, int desiredMaxDimension, int mipToSave, bool removeAlpha = true, List customMasks = null ) : byte[]

Saves fully formatted image in specified format to byte array.

Save ( Stream destination, ImageEngineFormat format, MipHandling GenerateMips, int desiredMaxDimension, int mipToSave, bool removeAlpha = true, List customMasks = null ) : void

Saves image in specified format to stream. Stream position not reset before or after.

ToString ( ) : string

Gets string representation of ImageEngineImage.

비공개 메소드들

메소드 설명
GetWPFBitmap ( MipMap mip, int maxDimension, bool ShowAlpha ) : System.Windows.Media.Imaging.BitmapSource

메소드 상세

Dispose() 공개 메소드

Releases resources used by mipmap MemoryStreams.
public Dispose ( ) : void
리턴 void

GetWPFBitmap() 공개 메소드

Creates a WPF Bitmap from largest mipmap. Does NOT require that image remains alive.
public GetWPFBitmap ( int maxDimension, bool ShowAlpha = false, int mipIndex ) : System.Windows.Media.Imaging.BitmapSource
maxDimension int Resizes image or uses a mipmap if available. Overrides mipIndex if specified.
ShowAlpha bool True = flattens alpha, directly affecting RGB.
mipIndex int Index of mipmap to retrieve. Overridden by maxDimension if it's specified.
리턴 System.Windows.Media.Imaging.BitmapSource

ImageEngineImage() 공개 메소드

Creates an image supporting many formats including DDS.
public ImageEngineImage ( MemoryStream stream, int maxDimension ) : CSharpImageLibrary.DDS
stream System.IO.MemoryStream Stream containing image.
maxDimension int Max dimension of created image. Useful for mipmapped images, otherwise resized.
리턴 CSharpImageLibrary.DDS

ImageEngineImage() 공개 메소드

Creates image from mipmap.
public ImageEngineImage ( MipMap mip ) : CSharpImageLibrary.DDS
mip MipMap Mipmap to use as source.
리턴 CSharpImageLibrary.DDS

ImageEngineImage() 공개 메소드

Creates an image supporting many formats including DDS.
public ImageEngineImage ( byte imageData, int maxDimension ) : CSharpImageLibrary.DDS
imageData byte Fully formatted image data, not just pixels.
maxDimension int Max dimension of created image. Useful for mipmapped images, otherwise resized.
리턴 CSharpImageLibrary.DDS

ImageEngineImage() 공개 메소드

Creates an image supporting many formats including DDS.
public ImageEngineImage ( string path, int maxDimension ) : CSharpImageLibrary.DDS
path string Path to image.
maxDimension int Max dimension of created image. Useful for mipmapped images, otherwise resized.
리턴 CSharpImageLibrary.DDS

Load() 공개 메소드

public Load ( Stream stream, int maxDimension ) : void
stream Stream
maxDimension int
리턴 void

Resize() 공개 메소드

Scales top mipmap and DESTROYS ALL OTHERS.
public Resize ( double scale ) : void
scale double Scaling factor.
리턴 void

Resize() 공개 메소드

Resizes image. If single mip, scales to DesiredDimension. If multiple mips, finds closest mip and scales it (if required). DESTROYS ALL OTHER MIPS.
public Resize ( int DesiredDimension ) : void
DesiredDimension int Desired size of images largest dimension.
리턴 void

Save() 공개 메소드

Saves image in specified format to file. If file exists, it will be overwritten.
public Save ( string destination, ImageEngineFormat format, MipHandling GenerateMips, int desiredMaxDimension, int mipToSave, bool removeAlpha = true, List customMasks = null ) : System.Threading.Tasks.Task
destination string File to save to.
format ImageEngineFormat Desired image format.
GenerateMips MipHandling Determines how mipmaps are handled during saving.
desiredMaxDimension int Maximum size for saved image. Resizes if required, but uses mipmaps if available.
mipToSave int Index of mipmap to save as single image.
removeAlpha bool True = Alpha removed. False = Uses threshold value and alpha values to mask RGB FOR DXT1 ONLY, otherwise removes completely.
customMasks List Custom user defined masks for colours.
리턴 System.Threading.Tasks.Task

Save() 공개 메소드

Saves fully formatted image in specified format to byte array.
public Save ( ImageEngineFormat format, MipHandling GenerateMips, int desiredMaxDimension, int mipToSave, bool removeAlpha = true, List customMasks = null ) : byte[]
format ImageEngineFormat Format to save as.
GenerateMips MipHandling Determines how mipmaps are handled during saving.
desiredMaxDimension int Maximum size for saved image. Resizes if required, but uses mipmaps if available.
mipToSave int Index of mipmap to save directly.
removeAlpha bool True = Alpha removed. False = Uses threshold value and alpha values to mask RGB FOR DXT1, otherwise completely removed.
customMasks List Custom user defined masks for colours.
리턴 byte[]

Save() 공개 메소드

Saves image in specified format to stream. Stream position not reset before or after.
public Save ( Stream destination, ImageEngineFormat format, MipHandling GenerateMips, int desiredMaxDimension, int mipToSave, bool removeAlpha = true, List customMasks = null ) : void
destination Stream Stream to write to at current position.
format ImageEngineFormat Format to save to.
GenerateMips MipHandling Determines how mipmaps are handled during saving.
desiredMaxDimension int Maximum dimension of saved image. Keeps aspect.
mipToSave int Specifies a mipmap to save within the whole.
removeAlpha bool True = removes alpha. False = Uses threshold value and alpha values to mask RGB FOR DXT1 ONLY, otherwise removes completely.
customMasks List Custom user defined masks for DDS colours.
리턴 void

ToString() 공개 메소드

Gets string representation of ImageEngineImage.
public ToString ( ) : string
리턴 string