Trait winit::platform::windows::IconExtWindows
source · pub trait IconExtWindows: Sized {
// Required methods
fn from_path<P: AsRef<Path>>(
path: P,
size: Option<PhysicalSize<u32>>,
) -> Result<Self, BadIcon>;
fn from_resource(
ordinal: u16,
size: Option<PhysicalSize<u32>>,
) -> Result<Self, BadIcon>;
}
Available on
windows_platform
only.Expand description
Additional methods on Icon
that are specific to Windows.
Required Methods§
sourcefn from_path<P: AsRef<Path>>(
path: P,
size: Option<PhysicalSize<u32>>,
) -> Result<Self, BadIcon>
fn from_path<P: AsRef<Path>>( path: P, size: Option<PhysicalSize<u32>>, ) -> Result<Self, BadIcon>
Create an icon from a file path.
Specify size
to load a specific icon size from the file, or None
to load the default
icon size from the file.
In cases where the specified size does not exist in the file, Windows may perform scaling to get an icon of the desired size.
sourcefn from_resource(
ordinal: u16,
size: Option<PhysicalSize<u32>>,
) -> Result<Self, BadIcon>
fn from_resource( ordinal: u16, size: Option<PhysicalSize<u32>>, ) -> Result<Self, BadIcon>
Create an icon from a resource embedded in this executable or library.
Specify size
to load a specific icon size from the file, or None
to load the default
icon size from the file.
In cases where the specified size does not exist in the file, Windows may perform scaling to get an icon of the desired size.
Object Safety§
This trait is not object safe.