private static void DrawCircle( Graphics graphics, Pen pen, Point scaledcenter, uint scaledDiameter) { PointF pointF = ToolResultRender.Unscall(scaledcenter); float num = ToolResultRender.Unscall(scaledDiameter); graphics.TranslateTransform(pointF.X, pointF.Y); graphics.DrawEllipse(pen, (float)(-(double)num / 2.0), (float)(-(double)num / 2.0), num, num); graphics.ResetTransform(); }
private static void DrawArrow(Graphics graphics, Color color, WindowShape toolWindow) { PointF pointF = ToolResultRender.Unscall(toolWindow.Center); float angle = ToolResultRender.Unscall((float)toolWindow.Angle); using (Pen pen = new Pen(color, 3f)) { pen.EndCap = LineCap.ArrowAnchor; graphics.TranslateTransform(pointF.X, pointF.Y); graphics.RotateTransform(angle); graphics.DrawLine(pen, PointF.Empty, new PointF(15f, 0.0f)); graphics.DrawLine(pen, PointF.Empty, new PointF(0.0f, -15f)); graphics.ResetTransform(); } }
private static void DrawRectangle( Graphics graphics, Pen pen, Point scaledCenter, Size scaledSize, float scaledAngle) { PointF pointF = ToolResultRender.Unscall(scaledCenter); SizeF sizeF = ToolResultRender.Unscall(scaledSize); float angle = ToolResultRender.Unscall(scaledAngle); graphics.TranslateTransform(pointF.X, pointF.Y); graphics.RotateTransform(angle); graphics.DrawRectangle(pen, (float)(-(double)sizeF.Width / 2.0), (float)(-(double)sizeF.Height / 2.0), sizeF.Width, sizeF.Height); graphics.ResetTransform(); }