Texture.loadFromFile

Load the texture from a file on disk.

The area argument can be used to load only a sub-rectangle of the whole image. If you want the entire image then leave the default value (which is an empty IntRect). If the area rectangle crosses the bounds of the image, it is adjusted to fit the image size.

The maximum size for a texture depends on the graphics driver and can be retrieved with the getMaximumSize function.

If this function fails, the texture is left unchanged.

class Texture
bool
loadFromFile
(
const(char)[] filename
,)

Parameters

filename const(char)[]

Path of the image file to load

area IntRect

Area of the image to load

Return Value

Type: bool

true if loading was successful, false otherwise.

Meta