[lazarus] canvas of a paintbox

Mattias Gaertner nc-gaertnma at netcologne.de
Sat Jun 21 17:07:01 EDT 2003


On Sat, 21 Jun 2003 22:43:19 +0200
Manuel Pérez López <manuel.perez.lopez at hispalinux.es> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> For example:
> This lines drew a circle in the middle of a paintbox (with paintbox.left
> and paintbox.top into a form at 100,100, and  paintbox.width and
> paintbox.height dimensions 400,300, for example) :
> 
>    PaintBox1.Canvas.Pen.Width := 2;
>    PaintBox1.Canvas.Pen.Color:= clBlue;
>    xcenter:=Trunc(PaintBox1.Width/2);
>    ycenter:=Trunc(PaintBox1.Height/2);
>    PaintBox1.Canvas.Ellipse(xcenter-20,ycenter-20,xcenter+20,ycenter+20);
>    Repaint;

The 'Repaint;' indicates, that you are probably not drawing during a Paint
event. Drawing is not yet implemented for all cases outside the Paint
events. Can you use the PaintBox1.OnPaint instead?

Mattias



> 
> 
> 
> - -- 
> 
> Saludos
> Manuel Pérez López
> manuel.perez.lopez at hispalinux.es
> - -----------------------------------
> 
> 
> El Sábado, 21 de Junio de 2003 22:13, Mattias Gaertner escribió:
> > On Sat, 21 Jun 2003 21:50:40 +0200
> >
> > Manuel Pérez López <manuel.perez.lopez at hispalinux.es> wrote:
> > > Hello everyone:
> > >
> > > The cvs last update had a change for behavior of a paintbox canvas. I
> > > do not know if it is a bug or no. Before the update, all the lines I
> > > drew into a paintbox canvas, they were relative to the dimension of
> > > the paintbox. For example, the center of a paintbox canvas was
> > > x:=paintbox.with/2 and y:=paintbox.height/2. After the update, all
> > > this is no correct.
> >
> > How do you draw?
> >
> > > Someone help me with this change.
> >
> > Mattias
> >
> > _________________________________________________________________
> >      To unsubscribe: mail lazarus-request at miraclec.com with
> >                 "unsubscribe" as the Subject
> >    archives at http://www.lazarus.freepascal.org/mailarchives
> 
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.2 (GNU/Linux)
> 
> iD8DBQE+9MNsYvl2oJ24QTwRAibtAJ4oG5FlfoXeue1NSNo3n0NAtmqSXgCfW0fE
> +AG4hfsjela+vup64Z50Fyc=
> =Oyx9
> -----END PGP SIGNATURE-----
> 
> _________________________________________________________________
>      To unsubscribe: mail lazarus-request at miraclec.com with
>                 "unsubscribe" as the Subject
>    archives at http://www.lazarus.freepascal.org/mailarchives


-- 






More information about the Lazarus mailing list