|
|
|
|
|
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
public class Picture: DocXElement
|
|
|
public class Picture: DocXElement
|
|
|
{
|
|
|
{
|
|
|
|
|
|
private const int EmusInPixel = 9525;
|
|
|
|
|
|
|
|
|
internal Dictionary<PackagePart, PackageRelationship> picture_rels;
|
|
|
internal Dictionary<PackagePart, PackageRelationship> picture_rels;
|
|
|
|
|
|
|
|
|
internal Image img;
|
|
|
internal Image img;
|
|
|
|
|
|
|
|
|
where (a != null)
|
|
|
where (a != null)
|
|
|
select a.Value
|
|
|
select a.Value
|
|
|
).First();
|
|
|
).First();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.fileName =
|
|
|
|
|
|
(
|
|
|
|
|
|
from e in Xml.Descendants(XName.Get("cNvPr", "http://schemas.openxmlformats.org/drawingml/2006/picture"))
|
|
|
|
|
|
select e.Attribute("name").Value
|
|
|
|
|
|
).First();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.descr =
|
|
|
this.descr =
|
|
|
(
|
|
|
(
|
|
|
from e in Xml.Descendants()
|
|
|
from e in Xml.Descendants()
|
|
|
|
|
|
|
|
|
///</summary>
|
|
|
///</summary>
|
|
|
public string FileName
|
|
|
public string FileName
|
|
|
{
|
|
|
{
|
|
|
get { return fileName; }
|
|
|
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return img.FileName;
|
|
|
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
public int Width
|
|
|
public int Width
|
|
|
{
|
|
|
{
|
|
|
get { return cx / 4156; }
|
|
|
|
|
|
|
|
|
get { return cx / EmusInPixel; }
|
|
|
|
|
|
|
|
|
set
|
|
|
set
|
|
|
{
|
|
|
{
|
|
|
cx = value;
|
|
|
cx = value;
|
|
|
|
|
|
|
|
|
foreach (XAttribute a in Xml.Descendants().Attributes(XName.Get("cx")))
|
|
|
foreach (XAttribute a in Xml.Descendants().Attributes(XName.Get("cx")))
|
|
|
a.Value = (cx * 4156).ToString();
|
|
|
|
|
|
|
|
|
a.Value = (cx * EmusInPixel).ToString();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
public int Height
|
|
|
public int Height
|
|
|
{
|
|
|
{
|
|
|
get { return cy / 4156; }
|
|
|
|
|
|
|
|
|
get { return cy / EmusInPixel; }
|
|
|
|
|
|
|
|
|
set
|
|
|
set
|
|
|
{
|
|
|
{
|
|
|
cy = value;
|
|
|
cy = value;
|
|
|
|
|
|
|
|
|
foreach (XAttribute a in Xml.Descendants().Attributes(XName.Get("cy")))
|
|
|
foreach (XAttribute a in Xml.Descendants().Attributes(XName.Get("cy")))
|
|
|
a.Value = (cy * 4156).ToString();
|
|
|
|
|
|
|
|
|
a.Value = (cy * EmusInPixel).ToString();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|