34 lines
868 B
C#
34 lines
868 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace ChaserLibrary
|
|
{
|
|
public class PainterWinform : IPaintable
|
|
{
|
|
Graphics PainterG { get; set; }
|
|
static Pen PenG { get; set; } = new Pen(Color.Black);
|
|
|
|
public PainterWinform(Graphics painterG)
|
|
{
|
|
PainterG = painterG;
|
|
}
|
|
|
|
public void PaintCircle(double X, double Y, int radius)
|
|
{
|
|
PainterG.DrawEllipse(PenG, new Rectangle((int) X, (int) Y, radius, radius));
|
|
}
|
|
|
|
public void PaintCross(double X, double Y)
|
|
{
|
|
int x = (int) X;
|
|
int y = (int) Y;
|
|
PainterG.DrawLine(PenG, x - 5, y - 5, x + 5, y + 5);
|
|
PainterG.DrawLine(PenG, x + 5, y - 5, x - 5, y + 5);
|
|
}
|
|
|
|
}
|
|
}
|