|
아날라고 시계와 비슷한데요.
360도를 특정갯수로 나눈 위치의 좌표값을 알아내고 싶어요
4개로 나눈다면 12시 3시 6시 9시 위치의 좌표가 되겠네요
더 많아 질수도 있고요.
여기저기 뒤져서 아날로그 시계소스를 찾아서 해보고 있는데 이해력이 부족해서요 답변 부탁드릴께요
procedure TfrmMain.MakeCoordData;
var
iCnt: Integer;
nInterval: Integer;
nRadius: Integer;
cx, cy : real;
x, y : integer;
v: Integer;
begin
//전체 발신번호의 갯수를 찾는다.
SendNumCnt := grdSend.RowCount - 1;
nRadius := 300;
iCnt := 0;
nInterval := 360 div SendNumCnt;
cx := frmRelation.imgBack.Width / 2;
for iCnt := 0 to SendNumCnt do
begin
v := iCnt;
x := Round(cx + cx * cos(6 * v * pi / 180));
y := Round(cx + cx * sin(6 * v * pi / 180));
grdSend.Cells[2, iCnt] := intTostr(x);
grdSend.Cells[3, iCnt] := intTostr(y);
end;
end;
|