예제 #1
0
        public override void DrawInContext(CoreGraphics.CGContext ctx)
        {
            base.DrawInContext(ctx);
            var rect = this.Frame;

            switch (Type)
            {
            case GradientType.Linear:
                linearGradient.Draw(ctx, rect);
                break;

            case GradientType.Radial:
                radialGradient.Draw(ctx, rect);
                break;

            case GradientType.Ellipse:
                ellipticalGradient.Draw(ctx, rect);
                break;

            case GradientType.Multi:
                multiGradient.Draw(ctx, rect);
                break;

            default:
                throw new NotImplementedException("The target gradient type is not supported: " + Type);
            }
        }
예제 #2
0
        public void DrawLayer(CALayer layer, CoreGraphics.CGContext context)
        {
            NSGraphicsContext.GlobalSaveGraphicsState();
            NSGraphicsContext graphicsContext = NSGraphicsContext.FromGraphicsPort(context, true);

            NSGraphicsContext.CurrentContext = graphicsContext;

            NSBezierPath path = new NSBezierPath();
            //ベジェ曲線
            var x1 = this.Frame.Left;
            var y1 = this.Frame.Top;
            var x2 = this.Frame.Right;
            var y2 = this.Frame.Bottom;

            path.MoveTo(new CoreGraphics.CGPoint(x1, y1));
            path.CurveTo(new CoreGraphics.CGPoint(x2, y1),
                         new CoreGraphics.CGPoint(x1, y2),
                         new CoreGraphics.CGPoint(x2, y2));
            //背景は白
            NSColor.White.Set();
            path.Fill();
            //線は青
            NSColor.Blue.Set();
            //線の太さ
            path.LineWidth = 2;
            path.Stroke();

            NSGraphicsContext.GlobalRestoreGraphicsState();
        }
예제 #3
0
        public void DrawLayer(CALayer layer, CoreGraphics.CGContext context)
        {
            double elapsedBpm = GetBpmStep();//BpmToProgress > 0 ? BpmToProgress : Timer.GetElapsedBpm();

            //BpmToProgress = 0;

            CATransaction.DisableActions    = true;
            CATransaction.AnimationDuration = 0;
            context.SaveState();

            foreach (Lane lane in Lanes)
            {
                lane.DrawFrame(context, elapsedBpm);

                context.TranslateCTM((nfloat)BounceHelper.BottomLaneSpacing, 0);
            }

            context.RestoreState();
        }
예제 #4
0
 partial void InitFromContext(CoreGraphics.CGContext context);
예제 #5
0
 public Graphics(CoreGraphics.CGContext context)
 {
     InitFromContext(context);
 }
 public override void DrawLayer(CoreAnimation.CALayer layer, CoreGraphics.CGContext context)
 {
     AddView(buttonView);
 }
예제 #7
0
 public void DrawHeaderText(string text, RGBrush brush, Rectangle rect)
 {
     throw new NotImplementedException();
 }
예제 #8
0
 public void ReleasePen(RGPen pen)
 {
     throw new NotImplementedException();
 }