pub struct Image { /* private fields */ }
Implementations§
Source§impl Image
§Example
extern crate umya_spreadsheet;
let mut book = umya_spreadsheet::new_file();
// Add Image
let mut marker = umya_spreadsheet::structs::drawing::spreadsheet::MarkerType::default();
marker.set_coordinate("B3");
let mut image = umya_spreadsheet::structs::Image::default();
image.new_image("./images/sample1.png", marker);
book.get_sheet_by_name_mut("Sheet1").unwrap()
.add_image(image);
// Get Image by Worksheet.
let worksheet = book.get_sheet_by_name_mut("Sheet1").unwrap();
let image = worksheet.get_image("B3");
let image = worksheet.get_image_by_column_and_row(&2, &1);
let image = worksheet.get_image_mut("B3");
let image = worksheet.get_image_by_column_and_row_mut(&2, &1);
// Use this if there are multiple Images in a given cell.
let images = worksheet.get_images("B3");
let images = worksheet.get_images_by_column_and_row(&2, &1);
let images = worksheet.get_images_mut("B3");
let images = worksheet.get_images_by_column_and_row_mut(&2, &1);
// Download Image
book.get_sheet_by_name("Sheet1").unwrap()
.get_image_collection()
.get(0)
.unwrap()
.download_image("./tests/result_files/bbb.png");
// Change Image
book.get_sheet_by_name_mut("Sheet1").unwrap()
.get_image_collection_mut()
.get_mut(0)
.unwrap()
.change_image("./images/sample1.png");
impl Image
§Example
extern crate umya_spreadsheet;
let mut book = umya_spreadsheet::new_file();
// Add Image
let mut marker = umya_spreadsheet::structs::drawing::spreadsheet::MarkerType::default();
marker.set_coordinate("B3");
let mut image = umya_spreadsheet::structs::Image::default();
image.new_image("./images/sample1.png", marker);
book.get_sheet_by_name_mut("Sheet1").unwrap()
.add_image(image);
// Get Image by Worksheet.
let worksheet = book.get_sheet_by_name_mut("Sheet1").unwrap();
let image = worksheet.get_image("B3");
let image = worksheet.get_image_by_column_and_row(&2, &1);
let image = worksheet.get_image_mut("B3");
let image = worksheet.get_image_by_column_and_row_mut(&2, &1);
// Use this if there are multiple Images in a given cell.
let images = worksheet.get_images("B3");
let images = worksheet.get_images_by_column_and_row(&2, &1);
let images = worksheet.get_images_mut("B3");
let images = worksheet.get_images_by_column_and_row_mut(&2, &1);
// Download Image
book.get_sheet_by_name("Sheet1").unwrap()
.get_image_collection()
.get(0)
.unwrap()
.download_image("./tests/result_files/bbb.png");
// Change Image
book.get_sheet_by_name_mut("Sheet1").unwrap()
.get_image_collection_mut()
.get_mut(0)
.unwrap()
.change_image("./images/sample1.png");
pub fn get_two_cell_anchor(&self) -> Option<&TwoCellAnchor>
pub fn get_two_cell_anchor_mut(&mut self) -> Option<&mut TwoCellAnchor>
pub fn set_two_cell_anchor(&mut self, value: TwoCellAnchor) -> &mut Self
pub fn remove_two_cell_anchor(&mut self) -> &mut Self
pub fn get_one_cell_anchor(&self) -> Option<&OneCellAnchor>
pub fn get_one_cell_anchor_mut(&mut self) -> Option<&mut OneCellAnchor>
pub fn set_one_cell_anchor(&mut self, value: OneCellAnchor) -> &mut Self
pub fn remove_one_cell_anchor(&mut self) -> &mut Self
pub fn new_image(&mut self, path: &str, marker: MarkerType)
pub fn new_image_with_dimensions<B: Into<Vec<u8>>>( &mut self, height: u32, width: u32, image_name: &str, bytes: B, marker: MarkerType, )
pub fn change_image(&mut self, path: &str)
pub fn download_image(&self, path: &str)
pub fn has_image(&self) -> bool
pub fn get_image_name(&self) -> &str
pub fn get_image_data(&self) -> &[u8] ⓘ
pub fn get_image_data_base64(&self) -> String
pub fn get_coordinate(&self) -> String
pub fn get_col(&self) -> &u32
pub fn get_row(&self) -> &u32
pub fn get_from_marker_type(&self) -> &MarkerType
pub fn get_to_marker_type(&self) -> Option<&MarkerType>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Image
impl RefUnwindSafe for Image
impl Send for Image
impl Sync for Image
impl Unpin for Image
impl UnwindSafe for Image
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more