Exemple #1
0
        public static DefineShape2Tag Create(SwfStreamReader reader)
        {
            var tag = new DefineShape2Tag();

            tag.ShapeId     = reader.ReadUInt16();
            tag.ShapeBounds = SwfRect.Read(reader);
            tag.Shapes      = SwfShapesWithStyle.Read(reader, SwfShapesWithStyle.ShapeStyleType.Shape2);
            return(tag);
        }
        void AddShapesToLibrary(ushort define_id, SwfShapesWithStyle shapes)
        {
            var bitmap_styles = shapes.FillStyles.Where(p => p.Type.IsBitmapType);
            var define        = new SwfLibraryShapeDefine {
                Bitmaps  = bitmap_styles.Select(p => p.BitmapId).ToArray(),
                Matrices = bitmap_styles.Select(p => p.BitmapMatrix).ToArray()
            };

            Library.Defines.Add(define_id, define);
        }