Пример #1
0
        public void Paint(GraphicsPath path, Graphics g, int time, float opacity)
        {
            int num1 = 0;
            int num2 = 0;
            GraphicsContainer container1 = g.BeginContainer();

            AnimFunc.CreateAnimateValues(this, time, out num1, out num2);
            g.SmoothingMode = base.OwnerDocument.SmoothingMode;
            bool  flag1   = this.Units == Units.UserSpaceOnUse;
            float single1 = this.X;
            float single2 = this.Y;
            float single3 = this.Width;
            float single4 = this.Height;

            ItopVector.Core.Types.ViewBox box1 = TypeFunc.ParseViewBox(this);
            Matrix matrix1 = new Matrix();

            if (box1 != null)
            {
                matrix1 = box1.GetViewMatrix(this);
            }
            RectangleF ef1 = path.GetBounds();

            if (!flag1)
            {
                single1 *= ef1.Width;
                single2 *= ef1.Height;
                single3  = (int)Math.Min((float)(single3 * ef1.Width), ef1.Width);
                single4  = (int)Math.Min((float)(single4 * ef1.Height), ef1.Height);
            }
            this.coord = matrix1.Clone();
            PointF[] tfArray1 = new PointF[7] {
                new PointF(single1 + (single3 / 2f), single2 + (single4 / 2f)), new PointF(single1, single2 + (single4 / 2f)), new PointF(single1 + single3, single2), new PointF(single1 + (single3 / 2f), single2), new PointF(single1 + single3, single2 + (single4 / 2f)), new PointF(single1 + (single3 / 2f), single2 + single4), new PointF(single1, single2 + single4)
            };
            this.boundsPoints = tfArray1;
            this.graidentPath = new GraphicsPath();
            this.graidentPath.AddRectangle(new RectangleF(single1, single2, single3, single4));
            Bitmap   bitmap1   = new Bitmap((int)single3, (int)single4);
            Graphics graphics1 = Graphics.FromImage(bitmap1);
            Matrix   matrix2   = matrix1.Clone();

            graphics1.Transform = matrix2;
            SvgElementCollection.ISvgElementEnumerator enumerator1 = this.graphList.GetEnumerator();
            while (enumerator1.MoveNext())
            {
                IGraph graph1 = (IGraph)enumerator1.Current;
                graph1.Draw(graphics1, time);
            }
            TextureBrush brush1 = new TextureBrush(bitmap1, new RectangleF(single1, single2, single3, single4));

            brush1.WrapMode  = WrapMode.Tile;
            brush1.Transform = this.Transform.Matrix;
            Matrix matrix3 = new Matrix(1f, 0f, 0f, 1f, ef1.X + (ef1.Width / 2f), ef1.Y + (ef1.Height / 2f));

            this.graidentPath.Transform(matrix3);
            matrix3.TransformPoints(this.boundsPoints);
            g.FillPath(brush1, path);
            bitmap1.Dispose();
            brush1.Dispose();
            g.EndContainer(container1);
        }