Ejemplo n.º 1
0
        /// <summary>
        /// Constructor used for deserialization
        /// </summary>
        /// <param name="info"></param>
        /// <param name="context"></param>
        public PlanarImage(SerializationInfo info, StreamingContext context)
        {
            Width        = info.GetInt32("Width");
            Height       = info.GetInt32("Height");
            BitsPerPixel = info.GetInt32("BitsPerPixel");
            PixelType    = (PixelAlignmentType)info.GetValue("PixelType", typeof(PixelAlignmentType));
            PlaneSizes   = (int[])info.GetValue("PlaneSizes", typeof(int[]));
            Pitches      = (int[])info.GetValue("Pitches", typeof(int[]));
            Lines        = (int[])info.GetValue("Lines", typeof(int[]));
            byte[] pixelData = (byte[])info.GetValue("PixelData", typeof(byte[]));
            NumberOfPlanes = info.GetInt32("NumberOfPlanes");
            PixelData px = new PixelData(PlaneSizes, pixelData);

            Planes = px.Load();
        }