C# 클래스 CSharpImageLibrary.TargaImage

Reads and loads a Truevision TGA Format image file.
상속: IDisposable
파일 보기 프로젝트 열기: KFreon/CSharpImageLibrary

공개 프로퍼티들

프로퍼티 타입 설명
ImageData byte[]
Palette System.Drawing.Imaging.ColorPalette

공개 메소드들

메소드 설명
Dispose ( ) : void

Disposes all resources used by this instance of the TargaImage class.

LoadTGAHeaderInfo ( BinaryReader binReader, TargaHeader objTargaHeader ) : void

Loads the Targa Header information from the file.

Save ( MemoryStream ms, System.Windows.Media.Imaging.WriteableBitmap img ) : void
TargaImage ( Stream stream, TargaHeader prevHeader = null ) : System

Creates TGA image from stream.

TargaImage ( TargaHeader prevHeader = null ) : System

Creates a new instance of the TargaImage object.

TargaImage ( string strFileName ) : System

Creates a new instance of the TargaImage object with strFileName as the image loaded.

보호된 메소드들

메소드 설명
Dispose ( bool disposing ) : void

Dispose(bool disposing) executes in two distinct scenarios. If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. If disposing equals false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed.

비공개 메소드들

메소드 설명
ClearAll ( ) : void

Clears out all objects and resources.

GetPixelFormat ( ) : PixelFormat

Gets the PixelFormat to be used by the Image based on the Targa file's attributes

LoadFromStream ( byte filebytes ) : MemoryStream
LoadImageBytes ( BinaryReader binReader ) : byte[]

Reads the image data bytes from the file. Handles Uncompressed and RLE Compressed image data. Uses FirstPixelDestination to properly align the image.

LoadTGAExtensionArea ( BinaryReader binReader ) : void

Loads the Targa Extension Area from the file, if it exists.

LoadTGAFooterInfo ( BinaryReader binReader ) : void

Loads the Targa Footer information from the file.

LoadTGAImage ( BinaryReader binReader ) : void

Reads the image data bytes from the file and loads them into the Image Bitmap object. Also loads the color map, if any, into the Image Bitmap.

LoadThumbnail ( BinaryReader binReader, PixelFormat pfPixelFormat ) : void

Loads the thumbnail of the loaded image file, if any.

ToWPF ( ) : System.Windows.Media.Imaging.BitmapSource

메소드 상세

Dispose() 공개 메소드

Disposes all resources used by this instance of the TargaImage class.
public Dispose ( ) : void
리턴 void

Dispose() 보호된 메소드

Dispose(bool disposing) executes in two distinct scenarios. If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. If disposing equals false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed.
protected Dispose ( bool disposing ) : void
disposing bool If true dispose all resources, else dispose only release unmanaged resources.
리턴 void

LoadTGAHeaderInfo() 공개 정적인 메소드

Loads the Targa Header information from the file.
public static LoadTGAHeaderInfo ( BinaryReader binReader, TargaHeader objTargaHeader ) : void
binReader System.IO.BinaryReader A BinaryReader that points the loaded file byte stream.
objTargaHeader TargaHeader
리턴 void

Save() 공개 메소드

public Save ( MemoryStream ms, System.Windows.Media.Imaging.WriteableBitmap img ) : void
ms System.IO.MemoryStream
img System.Windows.Media.Imaging.WriteableBitmap
리턴 void

TargaImage() 공개 메소드

Creates TGA image from stream.
public TargaImage ( Stream stream, TargaHeader prevHeader = null ) : System
stream Stream Stream containing image.
prevHeader TargaHeader TargaHeader if previously loaded.
리턴 System

TargaImage() 공개 메소드

Creates a new instance of the TargaImage object.
public TargaImage ( TargaHeader prevHeader = null ) : System
prevHeader TargaHeader
리턴 System

TargaImage() 공개 메소드

Creates a new instance of the TargaImage object with strFileName as the image loaded.
public TargaImage ( string strFileName ) : System
strFileName string
리턴 System

프로퍼티 상세

ImageData 공개적으로 프로퍼티

public byte[] ImageData
리턴 byte[]

Palette 공개적으로 프로퍼티

public ColorPalette,System.Drawing.Imaging Palette
리턴 System.Drawing.Imaging.ColorPalette