Пример #1
0
 public UGSolidColorBrush(IUGContext context, UGColor color)
 => _native = new SolidBrush(color.ToGDIColor());
Пример #2
0
 public UGRadialGradientBrush(IUGContext context, UGColor startColor, UGColor endColor)
     : this(context, startColor, endColor, UGEdgeBehavior.Clamp)
 {
 }
        public override void InitializeResources(IUGContext context)
        {
            _linear0 = new UGLinearGradientBrush(
                context,
                new Vector2(0F, 0F),
                new Vector2(1F, 0F),
                new[] {
                new UGGradientStop(UGColor.FromHSL(0F / 3F, 1F, .5F), .25F),
                new UGGradientStop(UGColor.FromHSL(2F / 3F, 1F, .5F), .75F),
            },
                UGEdgeBehavior.Clamp);
            _linear45 = new UGLinearGradientBrush(
                context,
                new Vector2(0F, 0F),
                new Vector2(1F, 1F),
                new[] {
                new UGGradientStop(UGColor.FromHSL(0F / 3F, 1F, .5F), .25F),
                new UGGradientStop(UGColor.FromHSL(2F / 3F, 1F, .5F), .75F),
            },
                UGEdgeBehavior.Clamp);
            _linear90 = new UGLinearGradientBrush(
                context,
                new Vector2(0F, 0F),
                new Vector2(0F, 1F),
                new[] {
                new UGGradientStop(UGColor.FromHSL(0F / 3F, 1F, .5F), .25F),
                new UGGradientStop(UGColor.FromHSL(2F / 3F, 1F, .5F), .75F),
            },
                UGEdgeBehavior.Clamp);

            _radialClamp = new UGRadialGradientBrush(
                context,
                new[] {
                new UGGradientStop(UGColor.FromHSL(0F / 3F, 1F, .5F), 0F),
                new UGGradientStop(UGColor.FromHSL(1F / 3F, 1F, .5F), .5F),
                new UGGradientStop(UGColor.FromHSL(2F / 3F, 1F, .5F), 1F),
            },
                UGEdgeBehavior.Clamp);
            _radialWrap = new UGRadialGradientBrush(
                context,
                new[] {
                new UGGradientStop(UGColor.FromHSL(0F / 3F, 1F, .5F), 0F),
                new UGGradientStop(UGColor.FromHSL(1F / 3F, 1F, .5F), .5F),
                new UGGradientStop(UGColor.FromHSL(2F / 3F, 1F, .5F), 1F),
            },
                UGEdgeBehavior.Wrap);
            _radialMirror = new UGRadialGradientBrush(
                context,
                new[] {
                new UGGradientStop(UGColor.FromHSL(0F / 3F, 1F, .5F), 0F),
                new UGGradientStop(UGColor.FromHSL(1F / 3F, 1F, .5F), .5F),
                new UGGradientStop(UGColor.FromHSL(2F / 3F, 1F, .5F), 1F),
            },
                UGEdgeBehavior.Mirror);

            _radialClamp2 = new UGRadialGradientBrush(
                context,
                new Vector2(.2F, .2F),
                .75F,
                new[] {
                new UGGradientStop(UGColor.FromHSL(0F / 3F, 1F, .5F), 0F),
                new UGGradientStop(UGColor.FromHSL(.5F / 3F, 1F, .5F), .25F),
                new UGGradientStop(UGColor.FromHSL(1F / 3F, 1F, .5F), .5F),
                new UGGradientStop(UGColor.FromHSL(1.5F / 3F, 1F, .5F), .75F),
                new UGGradientStop(UGColor.FromHSL(2F / 3F, 1F, .5F), 1F),
            },
                UGEdgeBehavior.Clamp);
            _radialWrap2 = new UGRadialGradientBrush(
                context,
                new Vector2(.2F, .2F),
                .75F,
                new[] {
                new UGGradientStop(UGColor.FromHSL(0F / 3F, 1F, .5F), 0F),
                new UGGradientStop(UGColor.FromHSL(.5F / 3F, 1F, .5F), .25F),
                new UGGradientStop(UGColor.FromHSL(1F / 3F, 1F, .5F), .5F),
                new UGGradientStop(UGColor.FromHSL(1.5F / 3F, 1F, .5F), .75F),
                new UGGradientStop(UGColor.FromHSL(2F / 3F, 1F, .5F), 1F),
            },
                UGEdgeBehavior.Wrap);
            _radialMirror2 = new UGRadialGradientBrush(
                context,
                new Vector2(.2F, .2F),
                .75F,
                new[] {
                new UGGradientStop(UGColor.FromHSL(0F / 3F, 1F, .5F), 0F),
                new UGGradientStop(UGColor.FromHSL(.5F / 3F, 1F, .5F), .25F),
                new UGGradientStop(UGColor.FromHSL(1F / 3F, 1F, .5F), .5F),
                new UGGradientStop(UGColor.FromHSL(1.5F / 3F, 1F, .5F), .75F),
                new UGGradientStop(UGColor.FromHSL(2F / 3F, 1F, .5F), 1F),
            },
                UGEdgeBehavior.Mirror);
        }
Пример #4
0
 public UGSolidColorBrush(IUGContext context, UGColor color)
 {
     _native = color.ToCGColor();
 }
Пример #5
0
 public UGSolidColorBrush(IUGContext context, UGColor color)
 => _native = new CanvasSolidColorBrush(((UGContext)context).Device, color.ToWinRTColor());
Пример #6
0
 public UGTextLayout(IUGContext context, string textString, IUGTextFormat textFormat, UGSize requestedSize)
 {
     _native        = new NSString(textString);
     _textFormat    = (UGTextFormat)textFormat;
     _requestedSize = requestedSize;
 }
Пример #7
0
 public UGLinearGradientBrush(IUGContext context, Vector2 startPoint, Vector2 endPoint, UGColor startColor, UGColor endColor, UGEdgeBehavior edgeBehavior)
     : this(context, startPoint, endPoint, new[] { new UGGradientStop(startColor, 0F), new UGGradientStop(endColor, 1F) }, edgeBehavior)
 {
 }
Пример #8
0
 public UGRadialGradientBrush(IUGContext context, IEnumerable <UGGradientStop> gradientStops, UGEdgeBehavior edgeBehavior)
     : this(context, new Vector2(.5F, .5F), .5F, gradientStops, edgeBehavior)
 {
 }
Пример #9
0
 public UGPath(IUGContext context)
 {
 }
Пример #10
0
 public UGLinearGradientBrush(IUGContext context, UGColor startColor, UGColor endColor, float angle, UGEdgeBehavior edgeBehavior)
     : this(context, Vector2.Zero, UGLinearGradientHelper.EndPointFromAngle(angle), startColor, endColor, edgeBehavior)
 {
 }
Пример #11
0
 protected virtual void DrawOverride(IUGContext context)
 {
 }
 protected override void DrawOverride(IUGContext context)
 {
     Delegate?.OnDraw(context);
 }
Пример #13
0
 public UGPath(IUGContext context)
 {
     _context = (UGContext)context;
 }
Пример #14
0
 public UGRadialGradientBrush(IUGContext context, UGColor startColor, UGColor endColor, UGEdgeBehavior edgeBehavior)
     : this(context, new Vector2(.5F, .5F), .5F, new[] { new UGGradientStop(startColor, 0F), new UGGradientStop(endColor, 1F) }, edgeBehavior)
 {
 }
Пример #15
0
 public UGLinearGradientBrush(IUGContext context, Vector2 startPoint, Vector2 endPoint, IEnumerable <UGGradientStop> gradientStops)
     : this(context, startPoint, endPoint, gradientStops, UGEdgeBehavior.Clamp)
 {
 }
Пример #16
0
 public UGRadialGradientBrush(IUGContext context, IEnumerable <UGGradientStop> gradientStops)
     : this(context, gradientStops, UGEdgeBehavior.Clamp)
 {
 }
Пример #17
0
 public UGTextLayout(IUGContext context, string textString, IUGTextFormat textFormat)
     : this(context, textString, textFormat, UGSize.MaxValue)
 {
 }
Пример #18
0
 public UGRadialGradientBrush(IUGContext context, Vector2 center, float radius, IEnumerable <UGGradientStop> gradientStops)
     : this(context, center, radius, gradientStops, UGEdgeBehavior.Clamp)
 {
 }
Пример #19
0
 public UGPath(IUGContext context)
 => _native = new Path();