nå ok havde eller lige lavet dette
procedure TForm1.FormActivate(Sender: TObject);
var
i:integer;
deg:real;
center,outer,filler,inner,holder:TPoint;
width,fields:Integer;
begin
fields:=8;
width:=100;
outer.X:=round(Image1.Width/2);
outer.y:=0;
center.X:=round(Image1.Width/2);
center.Y:=round(Image1.Height/2);
inner.X:=floor((Image1.Width-width*2)/2);
inner.y:=0;
filler.X:=round((Image1.Width-width)/2);
filler.y:=0;
deg:=DegToRad(360/fields);
filler:=rotate(filler,deg/2);
Image1.Canvas.Pen.Width:=2;
for i:=0 to fields-1 do
begin
Image1.Canvas.MoveTo(outer.X+center.X,outer.Y+center.Y);
Image1.Canvas.LineTo(inner.X+center.X,inner.Y+center.Y);
holder:=outer;
outer:=rotate(outer,deg);
Image1.Canvas.Arc(0,0,Image1.Width,Image1.Height,holder.X,holder.Y,outer.X,outer.Y);
holder:=inner;
inner:=rotate(inner,deg);
Image1.Canvas.Arc(width,width,Image1.Width-width,Image1.Height-width,holder.X,holder.Y,inner.X,inner.Y);
end;
Randomize();
for i:=0 to fields-1 do
begin
Image1.Canvas.Brush.Color:=RGB(RandomRange(0,255),RandomRange(0,255),RandomRange(0,255));
Image1.Canvas.FloodFill(filler.X+center.X,filler.Y+center.Y,Image1.Canvas.Pen.Color,fsBorder);
filler:=rotate(filler,deg);
end;
end;
man skal bare putte en image component på forme som SKAL være kvadratisk.
så skulle du bare have sat width til den bredde et felt har(afstanden fra inner cirklen til yder cirklen) og fields til antallet af felter.