Einzelnen Beitrag anzeigen

Benutzerbild von bitsetter
bitsetter

Registriert seit: 17. Jan 2007
1.169 Beiträge
 
Turbo Delphi für Win32
 
#24

Re: Kreis in Vier teile einteilen ?

  Alt 12. Jun 2007, 00:32
Delphi-Quellcode:
procedure Ellipse4Farben(cav: TCanvas; iLeft, iTop, iW, iH: integer);
var
  iHalbW, iHalbH : integer;
begin
  iHalbW := iW div 2;
  iHalbH := iH div 2;
  with cav do
  begin
    Brush.Color := clSilver;
    Ellipse(iLeft, iTop, iLeft + iW, iTop+ iH);

    Pen.Color := clRed;
    Arc(iLeft, iTop, iLeft + iW, iTop + iH, iLeft + iW, iTop + iHalbH, iLeft + iHalbW, iTop);

    Pen.Color := clYellow;
    Arc(iLeft, iTop, iLeft + iW, iTop + iH, iLeft + iHalbW, iTop, iLeft, iTop + iHalbH);

    Pen.Color := clGreen;
    Arc(iLeft, iTop, iLeft + iW, iTop + iH, iLeft, iTop + iHalbH, iLeft + iHalbW, iTop + iH);

    Pen.Color := clAqua;
    Arc(iLeft, iTop, iLeft + iW, iTop + iH, iLeft + iHalbW, iTop + iH, iLeft + iW, iTop + iHalbH);
  end;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  Ellipse4Farben(image1.Canvas, 33, 50, 121, 81);
end;
Das Ganze jetzt mit einer Ellipse.
Gruß bitsetter
"Viele Wege führen nach Rom"
Wolfgang Mocker (geb. 1954), dt. Satiriker und Aphoristiker
  Mit Zitat antworten Zitat