Board index » delphi » Drawing on TImage.Canvas flickers in Delphi6

Drawing on TImage.Canvas flickers in Delphi6

I had a smooth plot refresh by redrawing Image.Canvas.Polyline using
pmXOR.

  FormPlot.Image1.Canvas.FillRect(ClientRect);  //uses Brush color
(white)
  FormPlot.Image1.Canvas.Pen.Mode := pmXOR;
  make new Array of points
  FormPlot.Image1.Canvas.PolyLine (Arr)   //draw
  for loop:
    FormPlot.Image1.Canvas.PolyLine (Arr)   //erase
    make new Array
    FormPlot.Image1.Canvas.PolyLine (Arr)   //draw new Array
  end loop;

But that was in Delphi 5, and the code compiled under D5 still runs
without flicker. Now I recompiled for D6 and a have flicker with the
gray horizontal line jumping around.
Anybody knows the reason?..  could help please?...
I would really appreciate this.

Regards
Dimitri Solomatine

 

Re:Drawing on TImage.Canvas flickers in Delphi6


Quote
Dimitri Solomatine wrote:
> I had a smooth plot refresh by redrawing Image.Canvas.Polyline using
> pmXOR.

>   FormPlot.Image1.Canvas.FillRect(ClientRect);  //uses Brush color
> (white)
>   FormPlot.Image1.Canvas.Pen.Mode := pmXOR;
>   make new Array of points
>   FormPlot.Image1.Canvas.PolyLine (Arr)   //draw
>   for loop:
>     FormPlot.Image1.Canvas.PolyLine (Arr)   //erase
>     make new Array
>     FormPlot.Image1.Canvas.PolyLine (Arr)   //draw new Array
>   end loop;

> But that was in Delphi 5, and the code compiled under D5 still runs
> without flicker. Now I recompiled for D6 and a have flicker with the
> gray horizontal line jumping around.
> Anybody knows the reason?..  could help please?...
> I would really appreciate this.

It's a bug with TImage.  Try setting the Stretch property to true.

Re:Drawing on TImage.Canvas flickers in Delphi6


Just in time :) XXX
Quote
"Mauro Pati?o" <M-Pat...@govst.edu> wrote in message

news:3CFB7181.29ACA46F@govst.edu...
Quote
> Dimitri Solomatine wrote:

> > I had a smooth plot refresh by redrawing Image.Canvas.Polyline using
> > pmXOR.

> >   FormPlot.Image1.Canvas.FillRect(ClientRect);  file://uses Brush color
> > (white)
> >   FormPlot.Image1.Canvas.Pen.Mode := pmXOR;
> >   make new Array of points
> >   FormPlot.Image1.Canvas.PolyLine (Arr)   file://draw
> >   for loop:
> >     FormPlot.Image1.Canvas.PolyLine (Arr)   file://erase
> >     make new Array
> >     FormPlot.Image1.Canvas.PolyLine (Arr)   file://draw new Array
> >   end loop;

> > But that was in Delphi 5, and the code compiled under D5 still runs
> > without flicker. Now I recompiled for D6 and a have flicker with the
> > gray horizontal line jumping around.
> > Anybody knows the reason?..  could help please?...
> > I would really appreciate this.

> It's a bug with TImage.  Try setting the Stretch property to true.

Re:Drawing on TImage.Canvas flickers in Delphi6


What you have to do, is to tell your Form, that it does not erease its
background.
Try following code:

{ ... }
  public
    { Public declarations }
    procedure WMEraseBkgnd(var Message: TWmEraseBkgnd); message
WM_ERASEBKGND;
  end;
{ ... }

{ ... }
procedure TForm1.WMEraseBkgnd(var Message: TWmEraseBkgnd);
begin
  Message.Result := 1;
end;
{ ... }

I think this should work.

azr...@pfucrew.de

"Dimitri Solomatine" <s...@ihe.nl> schrieb im Newsbeitrag
news:3CFB5FBB.9D77AC4E@ihe.nl...

Quote
> I had a smooth plot refresh by redrawing Image.Canvas.Polyline using
> pmXOR.

>   FormPlot.Image1.Canvas.FillRect(ClientRect);  //uses Brush color
> (white)
>   FormPlot.Image1.Canvas.Pen.Mode := pmXOR;
>   make new Array of points
>   FormPlot.Image1.Canvas.PolyLine (Arr)   //draw
>   for loop:
>     FormPlot.Image1.Canvas.PolyLine (Arr)   //erase
>     make new Array
>     FormPlot.Image1.Canvas.PolyLine (Arr)   //draw new Array
>   end loop;

> But that was in Delphi 5, and the code compiled under D5 still runs
> without flicker. Now I recompiled for D6 and a have flicker with the
> gray horizontal line jumping around.
> Anybody knows the reason?..  could help please?...
> I would really appreciate this.

> Regards
> Dimitri Solomatine

Other Threads