Esempio n. 1
0
        /**
         * Returns a prototype that is used to construct new shapes
         *
         * @return a prototype that is used to construct new shapes
         */


        internal static CT_Picture Prototype()
        {
            if (prototype == null)
            {
                CT_Picture pic = new CT_Picture();
                CT_PictureNonVisual nvpr = pic.AddNewNvPicPr();
                CT_NonVisualDrawingProps nvProps = nvpr.AddNewCNvPr();
                nvProps.id = (1);
                nvProps.name = ("Picture 1");
                nvProps.descr = ("Picture");
                CT_NonVisualPictureProperties nvPicProps = nvpr.AddNewCNvPicPr();
                nvPicProps.AddNewPicLocks().noChangeAspect = true;



                CT_BlipFillProperties blip = pic.AddNewBlipFill();
                blip.AddNewBlip().embed = "";
                blip.AddNewStretch().AddNewFillRect();

                CT_ShapeProperties sppr = pic.AddNewSpPr();
                CT_Transform2D t2d = sppr.AddNewXfrm();
                CT_PositiveSize2D ext = t2d.AddNewExt();
                //should be original picture width and height expressed in EMUs
                ext.cx = (0);
                ext.cy = (0);

                CT_Point2D off = t2d.AddNewOff();
                off.x=(0);
                off.y=(0);

                CT_PresetGeometry2D prstGeom = sppr.AddNewPrstGeom();
                prstGeom.prst = (ST_ShapeType.rect);
                prstGeom.AddNewAvLst();

                prototype = pic;
            }
            return prototype;
        }