Drag[en]gine Script Module DragonScript 1.35
Loading...
Searching...
No Matches
Dragengine.Gui.Image Class Reference

Immutable image resources. More...

Inheritance diagram for Dragengine.Gui.Image:

Constructors

Image new (String filename)
 Load image from file.
static void loadAsynchron (String filename, ResourceListener listener)
 Load image from file asynchronously.

Management

String getFilename ()
 Normalized filename the image has been loaded from.
int getWidth ()
 Width in pixels.
int getHeight ()
 Height in pixels.
Point getSize ()
 Width and height in pixels.
int getDepth ()
 Depth in layers.
int getComponentCount ()
 Component count in the range from 1 to 4.
int getBitCount ()
 Bit count which is 8, 16 or 32.
void saveToFile (String filename)
 Save image to file.
Image dropAlpha ()
 Drop alpha component.
bool equals (Object other)
 Image is equal to another object.
int hashCode ()
 Hash code for use as dictionary keys.
static bool equals (Image image1, Image image2)
 Images are equal.

Detailed Description

Immutable image resources.

Images can be loaded from file or produced by the game engine or modules. Once created the image content is immutable.

This is a native class. It can not be subclassed.

Member Function Documentation

◆ dropAlpha()

Image Dragengine.Gui.Image.dropAlpha ( )

Drop alpha component.

References getBitCount(), and getComponentCount().

Referenced by equals().

◆ equals() [1/2]

bool Dragengine.Gui.Image.equals ( Image image1,
Image image2 )
static

Images are equal.

In contrary to equals(Object) this is safe to be called with null values.

References dropAlpha().

◆ equals() [2/2]

bool Dragengine.Gui.Image.equals ( Object other)

Image is equal to another object.

Implements Object.equals(Object).

Returns
true if other is of type Image and both point to the same engine image resource.

References saveToFile().

Referenced by hashCode().

◆ getBitCount()

int Dragengine.Gui.Image.getBitCount ( )

Bit count which is 8, 16 or 32.

Referenced by dropAlpha().

◆ getComponentCount()

int Dragengine.Gui.Image.getComponentCount ( )

Component count in the range from 1 to 4.

References getSize().

Referenced by dropAlpha().

◆ getDepth()

int Dragengine.Gui.Image.getDepth ( )

Depth in layers.

References getHeight().

Referenced by saveToFile().

◆ getFilename()

String Dragengine.Gui.Image.getFilename ( )

Normalized filename the image has been loaded from.

References getFilename().

Referenced by getFilename().

◆ getHeight()

int Dragengine.Gui.Image.getHeight ( )

Height in pixels.

References getWidth().

Referenced by getDepth().

◆ getSize()

Point Dragengine.Gui.Image.getSize ( )

Width and height in pixels.

Referenced by getComponentCount().

◆ getWidth()

int Dragengine.Gui.Image.getWidth ( )

Width in pixels.

Referenced by getHeight().

◆ hashCode()

int Dragengine.Gui.Image.hashCode ( )

Hash code for use as dictionary keys.

Implements Object.hashCode().

References equals(), and hashCode().

Referenced by hashCode().

◆ loadAsynchron()

void Dragengine.Gui.Image.loadAsynchron ( String filename,
ResourceListener listener )
static

Load image from file asynchronously.

Registers a request in the game engine to load an image. Once finished or if the file is already loaded the listener is used to deliver the loaded image or null if the loading failed.

References loadAsynchron().

Referenced by loadAsynchron().

◆ new()

Image Dragengine.Gui.Image.new ( String filename)

Load image from file.

If the image file has been already loaded it is assigned to this object. If the image is not loaded yet the engine loads the image. This call blocks until the image is fully loaded and ready to be used. For asynchronous loading use loadAsynchron(). Multiple objects can point to the same loaded image resource. Once no object instance uses an image file anymore it is released from memory.

References new().

Referenced by new().

◆ saveToFile()

void Dragengine.Gui.Image.saveToFile ( String filename)

Save image to file.

References getDepth().

Referenced by equals().


The documentation for this class was generated from the following file: