예제 #1
0
        /// <summary> Initializes the drawing data from the escher record read in</summary>
        private void  initialize()
        {
            EscherRecordData er = new EscherRecordData(this, 0);

            Assert.verify(er.isContainer());

            escherData = new EscherContainer(er);

            Assert.verify(escherData.Length == drawingData.Length);
            Assert.verify(escherData.Type == EscherRecordType.DGG_CONTAINER);

            initialized = true;
        }
예제 #2
0
        /// <summary> Initializes the member variables from the Escher stream data</summary>
        private void  initialize()
        {
            EscherRecordData er = new EscherRecordData(this, 0);

            Assert.verify(er.isContainer());

            escherData = new EscherContainer(er);

            readSpContainer = null;
            if (escherData.Type == EscherRecordType.DG_CONTAINER)
            {
                EscherRecordData erd = new EscherRecordData(this, 80);
                Assert.verify(erd.Type == EscherRecordType.SP_CONTAINER);
                readSpContainer = new SpContainer(erd);
            }
            else
            {
                Assert.verify(escherData.Type == EscherRecordType.SP_CONTAINER);
                readSpContainer = new SpContainer(er);
            }

            Sp sp = (Sp)readSpContainer.Children[0];

            objectId = sp.ShapeId - 1024;

            Opt opt = (Opt)readSpContainer.Children[1];

            if (opt.getProperty(260) != null)
            {
                blipId = opt.getProperty(260).Value;
            }

            if (opt.getProperty(261) != null)
            {
                imageFile = new System.IO.FileInfo(opt.getProperty(261).stringValue);
            }
            else
            {
                logger.warn("no filename property for drawing");
                imageFile = new System.IO.FileInfo(System.Convert.ToString(blipId));
            }

            ClientAnchor clientAnchor = (ClientAnchor)readSpContainer.Children[2];

            x      = clientAnchor.X1;
            y      = clientAnchor.Y1;
            width  = clientAnchor.X2 - x;
            height = clientAnchor.Y2 - y;

            initialized = true;
        }