Skip to Main Content
PHP 5 Kochbuch, Third Edition
book

PHP 5 Kochbuch, Third Edition

by David Sklar, Adam Trachtenberg, Carsten Lucke, Matthias Brusdeylins, Ulrich Speidel, Stephan Schmidt
September 2009
Intermediate to advanced content levelIntermediate to advanced
912 pages
48h 11m
German
O'Reilly Verlag
Content preview from PHP 5 Kochbuch, Third Edition

18.2 Bogen, Ellipsen und Kreise zeichnen

Problem

Sie wollen leere oder gefüllte Kurven zeichnen. Beispielsweise wollen Sie ein Kuchendiagramm zeichnen, das das Ergebnis einer Benutzerumfrage anzeigt.

Lösung

Verwenden Sie ImageArc( ), um einen Bogen zu zeichnen:

ImageArc($image, $x, $y, $width, $height, $start, $end, $color);

Um eine Ellipse zu zeichnen, verwenden Sie ImageArc( ) und setzen $start auf 0 und $end auf 360:

ImageArc($image, $x, $y, $width, $height, 0, 360, $color);

Um einen Kreis zu zeichnen, verwenden Sie ImageArc( ), wobei Sie $start auf 0 und $end auf 360 setzen und den gleichen Wert für $width und $height verwenden:

ImageArc($image, $x, $y, $diameter, $diameter, 0, 360, $color);

Diskussion

Da die Funktion ImageArc( ) sehr flexibel ist, ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

PHP programmieren unter Windows

PHP programmieren unter Windows

Arno Hollosi
CSS Kochbuch, 3rd Edition

CSS Kochbuch, 3rd Edition

Joergen Lang, Christopher Schmitt

Publisher Resources

ISBN: 9783868993271Purchase book