A Texture based on an Image.
    public class ImageTexture : Texture

A Texture based on an Image. Can be created from an Image with CreateFromImage(Godot.Image, uint).

Inheritance Chain

Constructors

    public ImageTexture()

Properties

    public float LossyQuality { get; set; }

The storage quality for [constant STORAGE_COMPRESS_LOSSY].

    public StorageEnum Storage { get; set; }

The storage type (raw, lossy, or compressed).

Methods

    public void Create(int width, int height, Image.Format format, uint flags = 7u)

    public void CreateFromImage(Image image, uint flags = 7u)

    public Image.Format GetFormat()

Returns the format of the ImageTexture, one of Image.Format.

    [Obsolete("GetLossyStorageQuality is deprecated. Use the LossyQuality property instead.")]
    public float GetLossyStorageQuality()

Getter for LossyQuality

    [Obsolete("GetStorage is deprecated. Use the Storage property instead.")]
    public StorageEnum GetStorage()

Getter for Storage

    public Error Load(string path)

Load an ImageTexture from a file path.

    public void SetData(Image image)

Sets the Image of this ImageTexture.

    [Obsolete("SetLossyStorageQuality is deprecated. Use the LossyQuality property instead.")]
    public void SetLossyStorageQuality(float quality)

Setter for LossyQuality

    public void SetSizeOverride(Vector2 size)

Resizes the ImageTexture to the specified dimensions.

    [Obsolete("SetStorage is deprecated. Use the Storage property instead.")]
    public void SetStorage(StorageEnum mode)

Setter for Storage

Inner Types

StorageEnum

Name Value Description
Raw 0 [Image] data is stored raw and unaltered.
CompressLossy 1 [Image] data is compressed with a lossy algorithm. You can set the storage quality with [member lossy_quality].
CompressLossless 2 [Image] data is compressed with a lossless algorithm.
Tags: