Quiq::Gd::Component::ColorBar - Rechteck mit einem Farbverlauf
Quiq::Gd::Component
Fett hervorgehobene Attribute sind Pflichtangaben beim Konstruktor-Aufruf.
Breite der Grafik in Pixeln.
Höhe der Grafik in Pixeln.
Farben des Farbverlaufs.
Code:
use Quiq::Gd::Image; use Quiq::Gd::Component::ColorBar; # Konfiguration my $width = 300; my $height = 25; my $numColors = 512; # Grafik-Objekt instantiieren my $g = Quiq::Gd::Component::ColorBar->new( width=>$width, height=>$height, ); # Bild-Objekt instantiieren my $img = Quiq::Gd::Image->new($width,$height); # Grafik auf Bild zeichnen $g->render($img,0,0, colors=>[$img->rainbowColors($numColors)], );
Grafik:
[Nur im Browser sichtbar]
$g = $class->new(@keyVal);
Instantiiere ein Grafik-Objekt mit den Eigenschaften @keyVal (s. Abschnitt ATTRIBUTES) und liefere eine Referenz auf das Objekt zurück.
$g->render($img); $g->render($img,$x,$y,@keyVal); $class->render($img,$x,$y,@keyVal);
Zeichne die Grafik in Bild $img an Position ($x,$y). Die Methode liefert keinen Wert zurück.
siehe BASE CLASS
1.210
Frank Seitz, http://fseitz.de/
Copyright (C) 2023 Frank Seitz
This code is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Quiq, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Quiq
CPAN shell
perl -MCPAN -e shell install Quiq
For more information on module installation, please visit the detailed CPAN module installation guide.