Struct ico::IconDirEntry

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

One entry in an ICO or CUR file; a single icon or cursor.

Implementations§

Returns the type of resource stored in this entry, either an icon or a cursor.

Returns the width of the image, in pixels.

Returns the height of the image, in pixels.

Returns the bits-per-pixel (color depth) of the image. Returns zero if self.resource_type() == ResourceType::Cursor (since CUR files store hotspot coordinates in place of this field).

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 self.resource_type() != ResourceType::Cursor.

Returns true if the image is encoded as a PNG, or false if it is encoded as a BMP.

Returns the raw, encoded image data.

Decodes this entry into an image. Returns an error if the data is malformed or can’t be decoded.

Encodes an image in a new entry. The encoding method is chosen automatically based on the image. Returns an error if the encoding fails.

Encodes an image as a BMP in a new entry. The color depth is determined automatically based on the image. Returns an error if the encoding fails.

Encodes an image as a PNG in a new entry. The color depth is determined automatically based on the image. Returns an error if the encoding fails.

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.