Struct winit::Icon [−][src]
pub struct Icon { /* fields omitted */ }An icon used for the window titlebar, taskbar, etc.
Enabling the icon_loading feature provides you with several convenience methods for creating
an Icon from any format supported by the image
crate.
Methods
impl Icon[src]
impl Iconpub fn from_rgba(
rgba: Vec<u8>,
width: u32,
height: u32
) -> Result<Self, BadIcon>[src]
pub fn from_rgba(
rgba: Vec<u8>,
width: u32,
height: u32
) -> Result<Self, BadIcon>Creates an Icon from 32bpp RGBA data.
The length of rgba must be divisible by 4, and width * height must equal
rgba.len() / 4. Otherwise, this will return a BadIcon error.
pub fn from_path<P: AsRef<Path>>(path: P) -> ImageResult<Self>[src]
pub fn from_path<P: AsRef<Path>>(path: P) -> ImageResult<Self>Loads an Icon from the path of an image on the filesystem.
Requires the icon_loading feature.
pub fn from_reader<R: BufRead + Seek>(
reader: R,
format: ImageFormat
) -> ImageResult<Self>[src]
pub fn from_reader<R: BufRead + Seek>(
reader: R,
format: ImageFormat
) -> ImageResult<Self>Loads an Icon from anything implementing BufRead and Seek.
Requires the icon_loading feature.
pub fn from_bytes(bytes: &[u8]) -> ImageResult<Self>[src]
pub fn from_bytes(bytes: &[u8]) -> ImageResult<Self>Loads an Icon from the unprocessed bytes of an image file.
Uses heuristics to determine format.
Requires the icon_loading feature.
pub fn from_bytes_with_format(
bytes: &[u8],
format: ImageFormat
) -> ImageResult<Self>[src]
pub fn from_bytes_with_format(
bytes: &[u8],
format: ImageFormat
) -> ImageResult<Self>Loads an Icon from the unprocessed bytes of an image.
Requires the icon_loading feature.
Trait Implementations
impl Debug for Icon[src]
impl Debug for Iconfn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl Clone for Icon[src]
impl Clone for Iconfn clone(&self) -> Icon[src]
fn clone(&self) -> IconReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl PartialEq for Icon[src]
impl PartialEq for Iconfn eq(&self, other: &Icon) -> bool[src]
fn eq(&self, other: &Icon) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &Icon) -> bool[src]
fn ne(&self, other: &Icon) -> boolThis method tests for !=.
impl Eq for Icon[src]
impl Eq for Iconimpl From<DynamicImage> for Icon[src]
impl From<DynamicImage> for IconRequires the icon_loading feature.
fn from(image: DynamicImage) -> Self[src]
fn from(image: DynamicImage) -> SelfPerforms the conversion.
impl From<RgbaImage> for Icon[src]
impl From<RgbaImage> for IconRequires the icon_loading feature.