+ /// Please note, that this method works correctly only for workbooks + /// with the default font size (Calibri 11pt for .xlsx). + /// If the default font is Changed the resized image can be streched vertically or horizontally. + ///
+ ///+ /// Please note, that this method works correctly only for workbooks + /// with the default font size (Calibri 11pt for .xlsx). + /// If the default font is Changed the resized image can be streched vertically or horizontally. + ///
+ ///resize(1.0)
Sets the original size, resize(0.5)
resize to 50% of the original,
+ ///resize(2.0)
resizes to 200% of the original.
+ ///
+ public void Resize(double scale)
+ {
+ XSSFClientAnchor anchor = (XSSFClientAnchor)ClientAnchor;
+
+ XSSFClientAnchor pref = GetPreferredSize(scale);
+
+ int row2 = anchor.Row1 + (pref.Row2 - pref.Row1);
+ int col2 = anchor.Col1 + (pref.Col2 - pref.Col1);
+
+ anchor.Col2 = (/*setter*/col2);
+ anchor.Dx1 = (/*setter*/0);
+ anchor.Dx2 = (/*setter*/pref.Dx2);
+
+ anchor.Row2 = (/*setter*/row2);
+ anchor.Dy1 = (/*setter*/0);
+ anchor.Dy2 = (/*setter*/pref.Dy2);
+ }
+
+ ///