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.sheet_by_name_mut("Sheet1").unwrap().add_image(image);
// Get Image by Worksheet.
let worksheet = book.sheet_by_name_mut("Sheet1").unwrap();
let image = worksheet.image_mut("B3");
let image = worksheet.image_by_column_and_row_mut(2, 1);
// Use this if there are multiple Images in a given cell.
let images = worksheet.images("B3");
let images = worksheet.images_mut("B3");
// Download Image
book.sheet_by_name("Sheet1")
.unwrap()
.image_collection()
.get(0)
.unwrap()
.download_image("./tests/result_files/bbb.png");
// Change Image
book.sheet_by_name_mut("Sheet1")
.unwrap()
.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.sheet_by_name_mut("Sheet1").unwrap().add_image(image);
// Get Image by Worksheet.
let worksheet = book.sheet_by_name_mut("Sheet1").unwrap();
let image = worksheet.image_mut("B3");
let image = worksheet.image_by_column_and_row_mut(2, 1);
// Use this if there are multiple Images in a given cell.
let images = worksheet.images("B3");
let images = worksheet.images_mut("B3");
// Download Image
book.sheet_by_name("Sheet1")
.unwrap()
.image_collection()
.get(0)
.unwrap()
.download_image("./tests/result_files/bbb.png");
// Change Image
book.sheet_by_name_mut("Sheet1")
.unwrap()
.image_collection_mut()
.get_mut(0)
.unwrap()
.change_image("./images/sample1.png");pub fn two_cell_anchor(&self) -> Option<&TwoCellAnchor>
pub fn get_two_cell_anchor(&self) -> Option<&TwoCellAnchor>
👎Deprecated since 3.0.0:
Use two_cell_anchor()
pub fn two_cell_anchor_mut(&mut self) -> Option<&mut TwoCellAnchor>
pub fn get_two_cell_anchor_mut(&mut self) -> Option<&mut TwoCellAnchor>
👎Deprecated since 3.0.0:
Use two_cell_anchor_mut()
pub fn set_two_cell_anchor(&mut self, value: TwoCellAnchor) -> &mut Self
pub fn remove_two_cell_anchor(&mut self) -> &mut Self
pub fn one_cell_anchor(&self) -> Option<&OneCellAnchor>
pub fn get_one_cell_anchor(&self) -> Option<&OneCellAnchor>
👎Deprecated since 3.0.0:
Use one_cell_anchor()
pub fn one_cell_anchor_mut(&mut self) -> Option<&mut OneCellAnchor>
pub fn get_one_cell_anchor_mut(&mut self) -> Option<&mut OneCellAnchor>
👎Deprecated since 3.0.0:
Use one_cell_anchor_mut()
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 image_name(&self) -> &str
pub fn get_image_name(&self) -> &str
👎Deprecated since 3.0.0:
Use image_name()
pub fn image_data(&self) -> &[u8] ⓘ
pub fn get_image_data(&self) -> &[u8] ⓘ
👎Deprecated since 3.0.0:
Use image_data()
pub fn image_data_base64(&self) -> String
pub fn get_image_data_base64(&self) -> String
👎Deprecated since 3.0.0:
Use image_data_base64()
pub fn coordinate(&self) -> String
pub fn get_coordinate(&self) -> String
👎Deprecated since 3.0.0:
Use coordinate()
pub fn col(&self) -> u32
pub fn get_col(&self) -> u32
👎Deprecated since 3.0.0:
Use col()
pub fn row(&self) -> u32
pub fn get_row(&self) -> u32
👎Deprecated since 3.0.0:
Use row()
pub fn from_marker_type(&self) -> &MarkerType
pub fn get_from_marker_type(&self) -> &MarkerType
👎Deprecated since 3.0.0:
Use from_marker_type()
pub fn to_marker_type(&self) -> Option<&MarkerType>
pub fn get_to_marker_type(&self) -> Option<&MarkerType>
👎Deprecated since 3.0.0:
Use to_marker_type()
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 UnsafeUnpin 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