使用Class进行绘画:
Class代码:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Drawing;
namespace prjPicture
{
public class Cross
{
public Cross(Graphics g, Point s, int w, int h)
{
Graphic = g;
startPoint = s;
width = w;
height = h;
DrawCross();
}
public Graphics Graphic { get; set; }
public Point startPoint { get; set; }
public int width { get; set; }
public int height { get; set; }
private void DrawCross()
{
Random random = new Random();