예제 #1
0
        public ImmagineFissa Retrieve(BinaryReader br)
        {
            // Immagine
            string nome = br.ReadString();

            // Modello
            Modello modello = Documento.getInstance().ModelloRiferimento;
            int     width   = br.ReadInt32();
            int     height  = br.ReadInt32();

            if (width != modello.Size.Width || height != modello.Size.Height)
            {
                return(null);
            }

            // Frame
            int nCol = br.ReadInt32();
            int len  = br.ReadInt32();

            byte[] frameAsArray = new byte[len];
            br.Read(frameAsArray, 0, len);

            // Informazione
            IPersister    infoPersister = PersisterFactory.GetPersister(br.ReadString());
            TypeAttribute attr          = (TypeAttribute)infoPersister.GetType().GetCustomAttribute(typeof(TypeAttribute));
            IInformazione infoAssociata = (IInformazione)infoPersister.Retrieve(br);

            // Out
            ImmagineFissa result = new ImmagineFissa(new Frame(frameAsArray, nCol, width * height), infoAssociata, nome);

            return(result);
        }