[Kde-perl] A newbee problem with Pen and CanvasPolygon
Alain EMPAIN
alain.empain at ulg.ac.be
Mon Apr 26 18:47:32 CEST 2004
I answer myself :-{
Qt Assistant :
------------------
'Note that QCanvasPolygon does not support an outline (the pen is always
NoPen).'
-------------------------------------------------------
Is there a way to trace an efficient polyline on a canvas ? ( I want to
avoid to use thousands canvasLine objects !).
I fiddle with Painter within a canvas or a canvas object
(canvasRectangle) but it does not seem to work.
I did not imagine that it is impossible to trace the outline of a
polygon within a canvas !
How to trace efficient XY graphs ?
Thanks for any advice.
Alain
On Sun, 2004-04-25 at 15:38, Alain EMPAIN wrote:
> Hello,
>
> I am discovering canvas, but up to now, I cannot see any Pen drawing
> when I draw a polygon. By the way, filling with the brush is effective.
>
> Any help will be welcome !
>
> --------------------------------
> (...)
> my $cp; # canvas polygon
> my $pa; # point array
> my $brush;
> my $pen;
> # ------------------------------------
> (..)
> $pen=Qt::Pen( &red, &SolidLine );
> $brush=Qt::Brush( &green, &Dense6Pattern );
> (..)
> $cp=Qt::CanvasPolygon($canvas);
> $cp->setBrush($brush);
> $cp->setPen($pen);
> $cp->setZ(255);
>
> # -- set the point array
> $pa=Qt::PointArray(15);
> $pa->setPoint(0,0,0);
> $pa->setPoint(1,100,100);
> $pa->setPoint(2,100,200);
> $pa->setPoint(3,1000,200);
> $pa->setPoint(4,500,800);
> $pa->setPoint(5,0,0);
>
> # --- load the points into the polygon
> $cp->setPoints($pa);
> $cp->show();
>
> # --------------
> $canvas->update();
> (..)
>
>
> No error, nice filling pattern but no border.
>
> Thanks,
>
> Alain
--
------------------------------------------------------------
Dr Alain Empain <alain.empain at ulg.ac.be> <alain at br.fgov.be>
Bioinformatics, Molecular Genetics,
Fac. Med. Vet., University of Liège, Belgium
Bd de Colonster, B43 B-4000 Liège (Sart-Tilman)
WORK: +32 4 366 3821 FAX: +32 4 366 4122
HOME: rue des Martyrs,7 B- 4550 Nandrin
+32 85 51 23 41 GSM: +32 497 70 17 64
More information about the Kde-perl
mailing list