コード例 #1
0
ファイル: ArrowElement.cs プロジェクト: RichardHaggard/BDC
        protected override bool PerformPaintTransformation(ref RadMatrix matrix)
        {
            bool  flag           = false;
            float angleTransform = this.AngleTransform;

            if ((double)angleTransform != 0.0)
            {
                flag = true;
                RectangleF bounds = new RectangleF(PointF.Empty, (SizeF)this.Bounds.Size);
                TelerikHelper.PerformCenteredRotation(ref matrix, bounds, angleTransform);
            }
            SizeF scaleTransform = this.ScaleTransform;

            if ((double)scaleTransform.Width > 0.0 && (double)scaleTransform.Height > 0.0 && ((double)scaleTransform.Width != 1.0 || (double)scaleTransform.Height != 1.0))
            {
                flag = true;
                matrix.Scale(scaleTransform.Width, scaleTransform.Height, MatrixOrder.Append);
            }
            SizeF positionOffset = this.PositionOffset;

            if (positionOffset != SizeF.Empty)
            {
                flag = true;
                matrix.Translate(this.RightToLeft ? -positionOffset.Width : positionOffset.Width, positionOffset.Height, MatrixOrder.Append);
            }
            return(flag);
        }
コード例 #2
0
        public static RectangleF PerformCenteredRotation(
            ref RadMatrix matrix,
            RectangleF bounds,
            float angle)
        {
            SizeF sz = new SizeF(bounds.Width / 2f, bounds.Height / 2f);

            matrix.RotateAt(angle, PointF.Add(bounds.Location, sz), MatrixOrder.Append);
            return(TelerikHelper.GetBoundingRect(bounds, matrix));
        }
コード例 #3
0
        public static RectangleF PerformTopLeftRotation(
            ref RadMatrix matrix,
            RectangleF bounds,
            float angle)
        {
            RadMatrix  identity   = RadMatrix.Identity;
            RectangleF rectangleF = TelerikHelper.PerformCenteredRotation(ref identity, bounds, angle);

            identity.Translate(bounds.X - rectangleF.X, bounds.Y - rectangleF.Y, MatrixOrder.Append);
            matrix.Multiply(identity, MatrixOrder.Append);
            return(new RectangleF(bounds.Location, rectangleF.Size));
        }
コード例 #4
0
        public static RectangleF GetBoundingRect(RectangleF rect, RadMatrix matrix)
        {
            PointF[] points = new PointF[4]
            {
                new PointF(rect.Left, rect.Top),
                new PointF(rect.Right, rect.Top),
                new PointF(rect.Right, rect.Bottom),
                new PointF(rect.Left, rect.Bottom)
            };
            TelerikHelper.TransformPoints(points, matrix.Elements);
            float left   = Math.Min(Math.Min(points[0].X, points[1].X), Math.Min(points[2].X, points[3].X));
            float right  = Math.Max(Math.Max(points[0].X, points[1].X), Math.Max(points[2].X, points[3].X));
            float top    = Math.Min(Math.Min(points[0].Y, points[1].Y), Math.Min(points[2].Y, points[3].Y));
            float bottom = Math.Max(Math.Max(points[0].Y, points[1].Y), Math.Max(points[2].Y, points[3].Y));

            return(RectangleF.FromLTRB(left, top, right, bottom));
        }
コード例 #5
0
ファイル: RadPrintElement.cs プロジェクト: RichardHaggard/BDC
        public RectangleF GetTransformedBounds(RectangleF bounds)
        {
            RadMatrix identity = RadMatrix.Identity;

            if (this.ScaleTransform != this.defaultScaleTransform)
            {
                identity.Translate(-bounds.X, -bounds.Y, MatrixOrder.Append);
                identity.Scale(this.ScaleTransform.Width, this.ScaleTransform.Height, MatrixOrder.Append);
                identity.Translate(bounds.X, bounds.Y, MatrixOrder.Append);
            }
            if ((double)this.AngleTransform != 0.0)
            {
                SizeF sz = new SizeF(bounds.Width / 2f, bounds.Height / 2f);
                identity.RotateAt(this.AngleTransform, PointF.Add(bounds.Location, sz), MatrixOrder.Append);
                RectangleF boundingRect = TelerikHelper.GetBoundingRect(bounds, identity);
                identity.Translate(bounds.X - boundingRect.X, bounds.Y - boundingRect.Y, MatrixOrder.Append);
            }
            return(identity.TransformRectangle(bounds));
        }
コード例 #6
0
        public static Rectangle GetBoundingRect(Rectangle rect, RadMatrix matrix)
        {
            if (matrix.IsIdentity)
            {
                return(rect);
            }
            Point[] points = new Point[4]
            {
                new Point(rect.Left, rect.Top),
                new Point(rect.Right, rect.Top),
                new Point(rect.Right, rect.Bottom),
                new Point(rect.Left, rect.Bottom)
            };
            TelerikHelper.TransformPoints(points, matrix.Elements);
            int left   = Math.Min(Math.Min(points[0].X, points[1].X), Math.Min(points[2].X, points[3].X));
            int right  = Math.Max(Math.Max(points[0].X, points[1].X), Math.Max(points[2].X, points[3].X));
            int top    = Math.Min(Math.Min(points[0].Y, points[1].Y), Math.Min(points[2].Y, points[3].Y));
            int bottom = Math.Max(Math.Max(points[0].Y, points[1].Y), Math.Max(points[2].Y, points[3].Y));

            return(Rectangle.FromLTRB(left, top, right, bottom));
        }
コード例 #7
0
ファイル: RootRadElement.cs プロジェクト: configare/hispeed
        //[Localizable(true), Description("Gets or sets the tooltip text associated with this item.")]
        //[DefaultValue(""), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        //[Browsable(false)]
        //public override string ToolTipText
        //{
        //    get
        //    {
        //        return base.ToolTipText;
        //    }
        //    set
        //    {
        //        base.ToolTipText = value;
        //    }
        //}

        //[DefaultValue(false),
        //Category(RadDesignCategory.BehaviorCategory),
        //Description("ToolStripItemAutoToolTipDescr"),
        //DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden),
        //Browsable(false)]
        //public override bool AutoToolTip
        //{
        //    get
        //    {
        //        return base.AutoToolTip;
        //    }
        //    set
        //    {
        //        base.AutoToolTip = value;
        //    }
        //}

        protected override bool PerformLayoutTransformation(ref RadMatrix matrix)
        {
            // No layout transformation needed for the root element as it represents the control itself.
            return(false);
        }
コード例 #8
0
ファイル: RootRadElement.cs プロジェクト: RichardHaggard/BDC
 protected override bool PerformLayoutTransformation(ref RadMatrix matrix)
 {
     return(false);
 }