public void FillPie(BrushX brush, float x, float y, float width, float height, float startAngle, float sweepAngle) { lock (this) { graphics.Brush = brush.WrappedBrush; bool positive = sweepAngle >= 0; float endAngle = startAngle + sweepAngle; startAngle = (float)TransformAngle(startAngle, width, height); sweepAngle = (float)TransformAngle(endAngle, width, height) - startAngle; if (positive && sweepAngle < 0) { sweepAngle += 360; } else if (!positive && sweepAngle >= 0) { sweepAngle -= 360; } graphics.Matrix = matrix == null ? null : matrix.matrix; graphics.FillPie( SingleFP.FromFloat(x), SingleFP.FromFloat(y), SingleFP.FromFloat(x + width), SingleFP.FromFloat(y + height), MathFP.ToRadians(SingleFP.FromFloat(startAngle)), MathFP.ToRadians(SingleFP.FromFloat(sweepAngle))); } }
public void DrawPie(PenX pen, float x, float y, float width, float height, float startAngle, float sweepAngle) { lock (this) { double a1 = startAngle * Math.PI / 180; double a2 = (startAngle + sweepAngle) * Math.PI / 180; graphics.Pen = PenX.ToPenFP(pen); bool positive = sweepAngle >= 0; float endAngle = startAngle + sweepAngle; startAngle = (float)TransformAngle(startAngle, width, height); sweepAngle = (float)TransformAngle(endAngle, width, height) - startAngle; if (positive && sweepAngle < 0) { sweepAngle += 360; } else if (!positive && sweepAngle >= 0) { sweepAngle -= 360; } graphics.Matrix = matrix == null ? null : matrix.matrix; graphics.DrawPie( SingleFP.FromFloat(x), SingleFP.FromFloat(y), SingleFP.FromFloat(x + width), SingleFP.FromFloat(y + height), MathFP.ToRadians(SingleFP.FromFloat(startAngle)), MathFP.ToRadians(SingleFP.FromFloat(sweepAngle))); } }
public void Rotate(float angle, MatrixOrderX order) { if (order == MatrixOrderX.Prepend) { MatrixFP m = MatrixFP.Identity(); m.Rotate(MathFP.ToRadians(SingleFP.FromFloat(angle))); m.Multiply(matrix); matrix = m; } else { matrix.Rotate(MathFP.ToRadians(SingleFP.FromFloat(angle))); } }
public void RotateAt(float angle, PointF point, MatrixOrderX order) { if (order == MatrixOrderX.Prepend) { MatrixFP m = MatrixFP.Identity(); m.Translate(SingleFP.FromFloat(-point.X), SingleFP.FromFloat(-point.Y)); m.Rotate(MathFP.ToRadians(SingleFP.FromFloat(angle))); m.Multiply(matrix); m.Translate(SingleFP.FromFloat(point.X), SingleFP.FromFloat(point.Y)); matrix = m; } else { matrix.Translate(SingleFP.FromFloat(-point.X), SingleFP.FromFloat(-point.Y)); matrix.Rotate(MathFP.ToRadians(SingleFP.FromFloat(angle))); matrix.Translate(SingleFP.FromFloat(point.X), SingleFP.FromFloat(point.Y)); } }