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); } }
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(); }
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(); }
partial void InitFromContext(CoreGraphics.CGContext context);
public Graphics(CoreGraphics.CGContext context) { InitFromContext(context); }
public override void DrawLayer(CoreAnimation.CALayer layer, CoreGraphics.CGContext context) { AddView(buttonView); }
public void DrawHeaderText(string text, RGBrush brush, Rectangle rect) { throw new NotImplementedException(); }
public void ReleasePen(RGPen pen) { throw new NotImplementedException(); }