| { | { | ||||
| return img.FileName; | return img.FileName; | ||||
| } | } | ||||
| } | |||||
| } | |||||
| /// <summary> | /// <summary> | ||||
| /// Get or sets the Width of this Image. | /// Get or sets the Width of this Image. | ||||
| } | } | ||||
| } | } | ||||
| // refs: | |||||
| // https://startbigthinksmall.wordpress.com/2010/01/04/points-inches-and-emus-measuring-units-in-office-open-xml/ | |||||
| // http://lcorneliussen.de/raw/dashboards/ooxml/ | |||||
| private const int InchToEmuFactor = 914400; | |||||
| private const double EmuToInchFactor = 1d / InchToEmuFactor; | |||||
| /// <summary> | |||||
| /// Get or sets the Width of this Image (inches). | |||||
| /// </summary> | |||||
| public double WidthInches | |||||
| { | |||||
| get | |||||
| { | |||||
| return Width * EmusInPixel * EmuToInchFactor; | |||||
| } | |||||
| set | |||||
| { | |||||
| Width = (int)(value * InchToEmuFactor / EmusInPixel); | |||||
| } | |||||
| } | |||||
| /// <summary> | |||||
| /// Get or sets the Height of this Image (inches). | |||||
| /// </summary> | |||||
| public double HeightInches | |||||
| { | |||||
| get | |||||
| { | |||||
| return Height * EmusInPixel * EmuToInchFactor; | |||||
| } | |||||
| set | |||||
| { | |||||
| Height = (int)(value * InchToEmuFactor / EmusInPixel); | |||||
| } | |||||
| } | |||||
| //public void Delete() | //public void Delete() | ||||
| //{ | //{ | ||||
| // // Remove xml | // // Remove xml | ||||
| // i.Remove(); | // i.Remove(); | ||||
| // // Rebuild the image collection for this paragraph | // // Rebuild the image collection for this paragraph | ||||
| // // Requires that every Image have a link to its paragraph | // // Requires that every Image have a link to its paragraph | ||||