圖片效果:
代碼如下:
public void Test1()
{
int Tp1 = 13;
int Tp2 = 1;
int Tp3 = 2;
int Tp4 = 1;
double tp1 = 13.0 / 27 * 100;
double tp2 = 1.0 / 27 * 100;
double tp3 = 2.0 / 27 * 100;
double tp4 = 1.0 / 27 * 100;
int width = 300, height = 300;//聲明寬與高
Bitmap bitmap = new Bitmap(width, height);//創建一個繪圖對象
Graphics g = Graphics.FromImage(bitmap);
try
{
g.Clear(Color.White);
//創建6個brush,用於填充顏色
Brush brush1 = new SolidBrush(Color.White);
Brush brush2 = new SolidBrush(Color.Black);