private void ReadHeaderFooterVmlDrawingPicture_shape(VmlDrawingPictureCollection target, XElement targetElement)
        {
            //奇数页眉  <oddHeader>  // 右 “RH”  中 "CH"  左 "LH"
            //偶数页眉  <evenHeader> // 右 "RHEVEN"  中间 “CHEVEN", 左 "LHEVEN" 
            //首页页眉  <firstHeader> // 右 ”RHFIRST“ 中间 "CHFIRST" 左 "LHFIRST"

            //奇数页脚  <oddFooter>   //F
            //偶数页脚  <evenFooter>  //CFEVEN 
            //首页页脚  <firstFooter>   FFIRST

            IEnumerable<XElement> shapetypes = targetElement.Elements(XName.Get("shape", ExcelCommon.schemaMicrosoftVml));
            VmlDrawingPicture itemPicture = null;
            XAttribute xAtbute = null;
            XElement childNode = null;
            foreach (XElement shapetypeNode in shapetypes)
            {
                itemPicture = new VmlDrawingPicture();
                xAtbute = shapetypeNode.Attribute(XName.Get("id"));
                if (xAtbute != null)
                    itemPicture.Id = xAtbute.Value;

                xAtbute = shapetypeNode.Attribute(XName.Get("style"));
                if (xAtbute != null)
                    ReadHeaderFooterVmlDrawingPicture_shape_style(itemPicture, xAtbute.Value);

                childNode = shapetypeNode.Element(XName.Get("imagedata", ExcelCommon.schemaMicrosoftVml));
                if (childNode != null)
                {
                    xAtbute = childNode.Attribute(XName.Get("relid", ExcelCommon.schemaMicrosoftOffice));
                    if (xAtbute != null)
                    {
                        PackageRelationship rel = this.Context.Package.GetPart(target.PictureUri).GetRelationship(xAtbute.Value);
                        Uri imageUri = PackUriHelper.ResolvePartUri(rel.SourceUri, rel.TargetUri);
                        itemPicture.Image = Image.FromStream(this.Context.Package.GetPart(imageUri).GetStream());
                    }

                    xAtbute = childNode.Attribute(XName.Get("title", ExcelCommon.schemaMicrosoftOffice));
                    if (xAtbute != null)
                        itemPicture.Title = xAtbute.Value;

                    xAtbute = childNode.Attribute(XName.Get("bilevel"));
                    if (xAtbute != null)
                        itemPicture.BiLevel = xAtbute.Value.Equals("t") ? true : false;

                    xAtbute = childNode.Attribute(XName.Get("grayscale"));
                    if (xAtbute != null)
                        itemPicture.BlackLevel = VmlDrawingPicture.GetFracDT(xAtbute.Value, 0);

                    xAtbute = childNode.Attribute(XName.Get("gain"));
                    if (xAtbute != null)
                        itemPicture.Gain = VmlDrawingPicture.GetFracDT(xAtbute.Value, 0);

                    xAtbute = childNode.Attribute(XName.Get("gamma"));
                    if (xAtbute != null)
                        itemPicture.Gamma = VmlDrawingPicture.GetFracDT(xAtbute.Value, 0);
                }

                /* <o:lock v:ext="edit" rotation="t"/>
                childNode = targetElement.Element(XName.Get("lock", ExcelCommon.schemaMicrosoftOffice));
                if (childNode != null)
                {
                    itemPicture.Title = childNode.Value;
                } */

                target.Add(itemPicture);
            }
        }
        internal void WriteReadHeaderFooterVmlDrawingPicture(VmlDrawingPictureCollection vmlDrawingPictureCollection)
        {
            PackagePart vmlDrawingHeaderFooter = this.Context.Package.CreatePart(vmlDrawingPictureCollection.PictureUri, ExcelCommon.ContentType_vmlDrawing, vmlDrawingPictureCollection._WorkSheet.WorkBook.Compression);

            XDocument vmlDrawingXml = new XDocument();
            XElement vmlDrawingXml_xml = new XElement("xml");
            vmlDrawingXml_xml.Add(new XAttribute(XName.Get("v", XNamespace.Xmlns.NamespaceName), ExcelCommon.schemaMicrosoftVml));
            vmlDrawingXml_xml.Add(new XAttribute(XName.Get("o", XNamespace.Xmlns.NamespaceName), ExcelCommon.schemaMicrosoftOffice));
            vmlDrawingXml_xml.Add(new XAttribute(XName.Get("x", XNamespace.Xmlns.NamespaceName), ExcelCommon.schemaMicrosoftExcel));

            XElement vmlDrawingXml_shapelayout = new XElement(XName.Get("shapelayout", ExcelCommon.schemaMicrosoftOffice),
                new XAttribute(XName.Get("ext", ExcelCommon.schemaMicrosoftVml), "edit"),
                new XElement(XName.Get("idmap", ExcelCommon.schemaMicrosoftOffice), new XAttribute(XName.Get("ext", ExcelCommon.schemaMicrosoftVml), "edit"), new XAttribute(XName.Get("data"), 1)));
            vmlDrawingXml_xml.Add(vmlDrawingXml_shapelayout);

            vmlDrawingXml_xml.Add(new XElement(XName.Get("shapetype", ExcelCommon.schemaMicrosoftVml),
                new XAttribute(XName.Get("id"), "_x0000_t75"),
                new XAttribute(XName.Get("coordsize"), "21600,21600"),
                new XAttribute(XName.Get("filled"), "f"),
                new XAttribute(XName.Get("path"), "m@4@5l@4@11@9@11@9@5xe"),
                new XAttribute(XName.Get("preferrelative", ExcelCommon.schemaMicrosoftOffice), "t"),
                new XAttribute(XName.Get("spt", ExcelCommon.schemaMicrosoftOffice), "75"),
                new XAttribute(XName.Get("stroked"), "f"),

                new XElement(XName.Get("stroke", ExcelCommon.schemaMicrosoftVml), new XAttribute(XName.Get("joinstyle"), "miter")),

                new XElement(XName.Get("formulas", ExcelCommon.schemaMicrosoftVml),
                   new XElement(XName.Get("f", ExcelCommon.schemaMicrosoftVml), new XAttribute(XName.Get("eqn"), "if lineDrawn pixelLineWidth 0")),
                   new XElement(XName.Get("f", ExcelCommon.schemaMicrosoftVml), new XAttribute(XName.Get("eqn"), "sum @0 1 0")),
                   new XElement(XName.Get("f", ExcelCommon.schemaMicrosoftVml), new XAttribute(XName.Get("eqn"), "sum 0 0 @1")),
                   new XElement(XName.Get("f", ExcelCommon.schemaMicrosoftVml), new XAttribute(XName.Get("eqn"), "prod @2 1 2")),
                   new XElement(XName.Get("f", ExcelCommon.schemaMicrosoftVml), new XAttribute(XName.Get("eqn"), "prod @3 21600 pixelWidth")),
                   new XElement(XName.Get("f", ExcelCommon.schemaMicrosoftVml), new XAttribute(XName.Get("eqn"), "prod @3 21600 pixelHeight")),
                   new XElement(XName.Get("f", ExcelCommon.schemaMicrosoftVml), new XAttribute(XName.Get("eqn"), "sum @0 0 1")),
                   new XElement(XName.Get("f", ExcelCommon.schemaMicrosoftVml), new XAttribute(XName.Get("eqn"), "prod @6 1 2")),
                   new XElement(XName.Get("f", ExcelCommon.schemaMicrosoftVml), new XAttribute(XName.Get("eqn"), "prod @7 21600 pixelWidth")),
                   new XElement(XName.Get("f", ExcelCommon.schemaMicrosoftVml), new XAttribute(XName.Get("eqn"), "sum @8 21600 0")),
                   new XElement(XName.Get("f", ExcelCommon.schemaMicrosoftVml), new XAttribute(XName.Get("eqn"), "prod @7 21600 pixelHeight")),
                   new XElement(XName.Get("f", ExcelCommon.schemaMicrosoftVml), new XAttribute(XName.Get("eqn"), "sum @10 21600 0"))),
                new XElement(XName.Get("path", ExcelCommon.schemaMicrosoftVml), new XAttribute(XName.Get("extrusionok", ExcelCommon.schemaMicrosoftOffice), "f"), new XAttribute(XName.Get("gradientshapeok"), "t"), new XAttribute(XName.Get("connecttype", ExcelCommon.schemaMicrosoftOffice), "rect")),
                new XElement(XName.Get("lock", ExcelCommon.schemaMicrosoftOffice), new XAttribute(XName.Get("ext", ExcelCommon.schemaMicrosoftVml), "edit"), new XAttribute(XName.Get("aspectratio"), "t"))
                   ));

            int index = 1;
            foreach (VmlDrawingPicture vdp in vmlDrawingPictureCollection)
            {
                ExcelImageInfo currentImage = SavePicture(vdp.Title, vdp.ImageFormat, vdp.Image, string.Empty);
                string relationship = string.Empty;
                if (this.Context.HashImageRelationships.ContainsKey(currentImage.Hash))
                {
                    relationship = this.Context.HashImageRelationships[currentImage.Hash];
                }
                else
                {
                    PackageRelationship picRelation = vmlDrawingHeaderFooter.CreateRelationship(PackUriHelper.GetRelativeUri(vmlDrawingPictureCollection.PictureUri, currentImage.Uri), TargetMode.Internal, ExcelCommon.Schema_Relationships + "/image");
                    relationship = picRelation.Id;
                    this.Context.HashImageRelationships.Add(currentImage.Hash, picRelation.Id);
                }

                XElement shapeNode = new XElement(
                    XName.Get("shape", ExcelCommon.schemaMicrosoftVml),
                    new XAttribute(XName.Get("id"), vdp.Id),
                    new XAttribute(XName.Get("type"), "#_x0000_t75"),
                    new XAttribute(XName.Get("style"), vdp.GetStyle(index)));

                XElement imagedataNode = new XElement(XName.Get("imagedata", ExcelCommon.schemaMicrosoftVml),
                    new XAttribute(XName.Get("relid", ExcelCommon.schemaMicrosoftOffice), relationship));
                if (string.IsNullOrEmpty(vdp.Title))
                    imagedataNode.Add(new XAttribute(XName.Get("title", ExcelCommon.schemaMicrosoftOffice), string.Format("图片{0}", index)));
                else
                    imagedataNode.Add(new XAttribute(XName.Get("title", ExcelCommon.schemaMicrosoftOffice), vdp.Title));

                if (vdp.BiLevel)
                    imagedataNode.Add(new XAttribute(XName.Get("bilevel"), "t"));

                if (vdp.GrayScale)
                    imagedataNode.Add(new XAttribute(XName.Get("grayscale"), "t"));

                if (vdp.Gain != 1)
                    imagedataNode.Add(new XAttribute(XName.Get("gain"), vdp.Gain.ToString("#.0#", CultureInfo.InvariantCulture)));

                if (vdp.Gamma != 0)
                    imagedataNode.Add(new XAttribute(XName.Get("gamma"), vdp.Gamma.ToString("#.0#", CultureInfo.InvariantCulture)));

                if (vdp.BlackLevel != 0)
                    imagedataNode.Add(new XAttribute(XName.Get("blacklevel"), vdp.BlackLevel.ToString("#.0#", CultureInfo.InvariantCulture)));

                shapeNode.Add(imagedataNode);

                shapeNode.Add(new XElement(XName.Get("lock", ExcelCommon.schemaMicrosoftOffice),
                    new XAttribute(XName.Get("ext", ExcelCommon.schemaMicrosoftVml), "edit"),
                    new XAttribute(XName.Get("rotation"), "t")));

                vmlDrawingXml_xml.Add(shapeNode);
            }

            using (StreamWriter stream = new StreamWriter(vmlDrawingHeaderFooter.GetStream(FileMode.Create, FileAccess.Write)))
            {
                vmlDrawingXml.Add(vmlDrawingXml_xml);
                stream.Write(vmlDrawingXml.ToString(SaveOptions.None).Replace("<?xml version=\"1.0\" encoding=\"utf-8\"?>", string.Empty));
                stream.Flush();
            }
        }
        internal void ReadHeaderFooterVmlDrawingPicture(VmlDrawingPictureCollection target, XElement targetElement)
        {
            XElement childNode = targetElement.Element(XName.Get("shapelayout", ExcelCommon.schemaMicrosoftOffice));
            if (childNode != null)
            {

            }
            childNode = targetElement.Element(XName.Get("shapetype", ExcelCommon.schemaMicrosoftVml));
            if (childNode != null)
            {

            }
            ReadHeaderFooterVmlDrawingPicture_shape(target, targetElement);
        }