|
speed 님이 쓰신 글 :
: Canvas의
: Canvas->Polyline( ), Canvas->Polygon( )
: 위의 두메소드 차이점이 뭔가요?
:
: 테스트 해보니 기능상 똑같은 것 같은데...
:
: 아시는 분 좀 알려주세요...
빌더의 도움말에 따르면 아래와 같습니다.
Polygon:
1. 첫번째 점에서 두번째 점으로 선을 그리는 등 마지막 점까지 선을 그린 다음
2. 마지막 점에서 첫번째 점 사이에 선을 그립니다.
3. 선들로 둘러싸인 내부를 현재의 Brush로 칠합니다.
Polyline:
1. 첫번째 점에서 두번째 점으로 선을 그리는 등 마지막 점까지 선을 그립니다.
결국 Polyline으로 Polygon의 효과를 내려면 Polyline의 Points 인수의 마지막 점에 첫번째 점을 다시 지정해주어야 하고 별도로 내부를 칠해주어야 합니다.
TCanvas::Polygon
Draws a series of lines on the canvas connecting the points passed in and closing the shape by drawing a line from the last point to the first point.
void __fastcall Polygon(const TPoint * Points, const int Points_Size);
Description
Use Polygon to draw a closed, many-sided shape on the canvas, using the value of Pen. After drawing the complete shape, Polygon fills the shape using the value of Brush.
The Points parameter is an array of points that give the vertices of the polygon.
The Points_Size parameter is the index of the last point in the array (one less than the total number of points).
The first point is always connected to the last point.
To draw a polygon on the canvas, without filling it, use the Polyline method, specifying the first point a second time at the end.
|