Struct ico::IconImage

source ·
pub struct IconImage { /* private fields */ }
Expand description

A decoded image.

Implementations§

Creates a new image with the given dimensions and RGBA data. The width and height must be nonzero, and rgba_data must have 4 * width * height bytes and be in row-major order from top to bottom. Panics if the dimensions are out of range or if rgba_data is the wrong length.

Decodes an image from a PNG file. Returns an error if the PNG data is malformed or can’t be decoded.

Encodes the image as a PNG file.

Returns the width of the image, in pixels.

Returns the height of the image, in pixels.

Returns the coordinates of the cursor hotspot (pixels right from the left edge of the image, and pixels down from the top edge), or None if this image is an icon rather than a cursor.

Sets or clears the cursor hotspot coordinates.

Returns the RGBA data for this image, in row-major order from top to bottom.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.