TgaImage.TgaImage

TgaImage(string)

Initializes a new TgaImage object using the provided file path for loading the image content. This constructor efficiently initializes the image instance, allowing seamless access to TGA image files, simplifying integration into your application workflow.

public TgaImage(string path)
ParameterTypeDescription
pathStringThe path to load an image.

Exceptions

exceptioncondition
ArgumentNullExceptionSpecified path is null.

See Also


TgaImage(RasterImage)

Create a new instance of the TgaImage class by providing a raster image object. This constructor facilitates the direct integration of existing raster images into the TGA image format, streamlining the conversion process for enhanced compatibility within your software systems.

public TgaImage(RasterImage rasterImage)
ParameterTypeDescription
rasterImageRasterImageThe raster image.

Examples

Loading of the PNG image, conversion of it to the TgaImage and saving as a TGA image.

[C#]

using (RasterImage image = (RasterImage)Image.Load("test.png"))
{
    using (TgaImage tgaImage = new TgaImage(image))
    {
        tgaImage.Save("test.tga");
    }
}

See Also


TgaImage(Stream)

Initialize a new instance of the TgaImage class using a stream to load the image. This constructor allows for seamless integration of image data from streams, facilitating efficient handling and processing of TGA images within your software applications.

public TgaImage(Stream stream)
ParameterTypeDescription
streamStreamThe stream to load an image.

See Also