/// Encodes the image into the family, automatically choosing an
/// appropriate icon type based on the dimensions of the image.  Returns
/// an error if there is no supported icon type matching the image
/// dimensions.
Encodes the image into the family, automatically choosing an
appropriate icon type based on the dimensions of the image.  Returns
an error if there is no supported icon type matching the image
dimensions.
Encodes the image into the family automatically choosing an appropriate icon type based on the dimensions of the image . Returns an error if there is no supported icon type matching the image dimensions .
pub fn add_icon(&mut self, image: &Image) -> io::Result<()> {
        if let Some(icon_type) = IconType::from_pixel_size(image.width(),
                                                           image.height()) {
            self.add_icon_with_type(image, icon_type)
        } else {
            let msg = format!("no supported icon type has dimensions {}x{}",
                              image.width(),
                              image.height());
            Err(Error::new(ErrorKind::InvalidInput, msg))
        }
    }
pub fn add_icon ( & mut self , image : & Image ) -> io :: Result < ( ) > { if let Some ( icon_type ) = IconType :: from_pixel_size ( image . width ( ) , image . height ( ) ) { self . add_icon_with_type ( image , icon_type ) } else { let msg = format ! ( " " image width ( ) image height ( ) ) ; Err ( Error :: new ( ErrorKind :: InvalidInput , msg ) ) } }
Encodes the image into the family, automatically choosing an
appropriate icon type based on the dimensions of the image.
Encodes the image into the family automatically choosing an appropriate icon type based on the dimensions of the image .
&mut self
image
&Image