コード例 #1
0
        internal RadialGradientBrush(Direct2DRenderTarget renderTargetOwner, 
                                     GradientStop[] gradientStops, 
                                     ExtendMode extendMode, 
                                     PointF centerPoint, 
                                     PointF gradientOriginOffset,
                                     SizeF radius)
        {
            m_renderTargetOwner = renderTargetOwner;
            m_extendMode = extendMode;
            m_radius = radius;
            m_gradientOriginOffset = gradientOriginOffset;
            m_centerPoint = centerPoint;

            var gradientStopList = new List<SlimDX.Direct2D.GradientStop>(gradientStops.Length);

            for (int i = 0; i < gradientStops.Length; i++)
            {
                gradientStopList.Add(gradientStops[i].InternalGradientStop);
            }

            var props = new RadialGradientBrushProperties();
            props.CenterPoint = centerPoint.InternalPointF;
            props.GradientOriginOffset = gradientOriginOffset.InternalPointF;
            props.HorizontalRadius = radius.Width;
            props.VerticalRadius = radius.Height;

            m_internalGradientStopCollection = new GradientStopCollection(m_renderTargetOwner.InternalRenderTarget,
                                                                          gradientStopList.ToArray(),
                                                                          Gamma.Linear,
                                                                          (SlimDX.Direct2D.ExtendMode)extendMode);

            m_internalRadialGradientBrush = new SlimDX.Direct2D.RadialGradientBrush(m_renderTargetOwner.InternalRenderTarget,
                                                                                    m_internalGradientStopCollection, props);
        }
コード例 #2
0
 public RoundedRectangleF(float x, float y, SizeF size, SizeF radius)
 {
     InternalRoundedRectangle = new RoundedRectangle();
     Left = x;
     Top = y;
     Right = Left + size.Width;
     Bottom = Top + size.Height;
     RadiusX = radius.Width;
     RadiusY = radius.Height;
 }
コード例 #3
0
        public void AddArc(PointF endPoint, SizeF size, float rotationAngle)
        {
            var segment = new ArcSegment();
            segment.ArcSize = ArcSize.Small;
            segment.EndPoint = endPoint.InternalPointF;
            segment.RotationAngle = rotationAngle;
            segment.Size = size.InternalSize;
            segment.SweepDirection = SweepDirection.Clockwise;

            m_geometrySink.AddArc(segment);
        }
コード例 #4
0
 public RadialGradientBrush CreateRadialGradientBrush(GradientStop[] gradientStops, ExtendMode extendMode, PointF centerPoint, PointF gradientOriginOffset, SizeF radius)
 {
     return new RadialGradientBrush(m_renderTargetResourceOwner, gradientStops, extendMode, centerPoint, gradientOriginOffset, radius);
 }
コード例 #5
0
 /// <summary>
 /// Creates a new CreateRadialGradientBrush for creating radial gradients.
 /// </summary>
 /// <param name="gradientStops">The gradient stop points</param>
 /// <param name="extendMode">The draw extend mode</param>
 /// <param name="centerPoint">The center point of the radial gradient. </param>
 /// <param name="gradientOriginOffset">This offset to move the origin, from center, of the radial gradient</param>
 /// <param name="radius">The radius of the gradiant</param>
 /// <returns>A new instance of RadialGradientBrush</returns>
 public Brushes.RadialGradientBrush CreateRadialGradientBrush(Brushes.GradientStop[] gradientStops, Brushes.ExtendMode extendMode, PointF centerPoint, PointF gradientOriginOffset, SizeF radius)
 {
     return m_resources.CreateRadialGradientBrush(gradientStops, extendMode, centerPoint, gradientOriginOffset, radius);
 }