이미지 상자에 다각형 목록을 그리려고합니다. 지금까지 화면의 왼쪽 상단 모서리에 검은 색 대각선 만 나타납니다. 다음과 같이 포인트는ImageBox 그래픽 실수
20,20 0,20 20,0 40, 40
200,100 0,20 20,0 20,20
100, 200 0 200 200,0 250, 450
150,130 1,20 20,0 10,20
private void pictureBox1_Paint_1(object sender, PaintEventArgs e)
{
int jobIndex = 0;
int trussIndex = 0;
Graphics g = e.Graphics;
foreach (Member m in jobArray[jobIndex].trusses[trussIndex].members)
{
Point[] pointArray = new Point[m.poly.Points.Count()];
//m.poly.Points.CopyTo(pointArray, 0);
int index =0;
foreach(System.Windows.Point p in m.poly.Points)
{
pointArray[index].X = (int)p.X;
pointArray[index].Y = (int)p.Y;
index++;
}
Pen myPen = new Pen(Color.Black);
SolidBrush myBrush = new SolidBrush(m.color);
g.DrawPolygon(myPen, pointArray);
g.FillPolygon(myBrush, pointArray);
}
}
이미지 상자에 폴리곤이 나타나지 않는 이유는 무엇입니까? 색상은 상자의 크기 나 이슈가 아닙니다.