Board index » delphi » TPaintbox.Canvas or MainForm.Canvas faster???

TPaintbox.Canvas or MainForm.Canvas faster???

Hi,

I'm currently rewriting an application of mine which reads IGES entities
(LINES,ARCS,SPLINES,TEXT) and draws these entities to the screen.

The way I used to do it was to write to the canvas of the mainform of the
app.

Is there a speed increase in using a TPaintbox as my canvas?

Is it faster to write to an invisible bitmap then write this bit map to the
visible canvas??

I'm looking for the fastest graphics possible using DELPHI 5.

Any help would be appreciated.

Thank you,
Charles Gipe

 

Re:TPaintbox.Canvas or MainForm.Canvas faster???


Hmm.. A canvas is a canvas is a canvas, I think. I'm working on a vector
tool that maintains the objects in a queue, draws them to a TBitmap, then
Blt's the bitmap onto my control's canvas. This solves a flicker problem,
but actually results in a decrease in speed due to the overhead from the
extra BLT operation.

To my knowledge, there should not be a difference in speed between a
Paintbox's canvas and a form's canvas, unless the form's canvas contains
controls. I'd recommed using either the paintbox or a custom control just
for the sake of organization and maintenance, though.

- D

"Gipe Software Dev. Inc." <g...@kvi.net> wrote in message
news:95nf31$ge913@bornews.inprise.com...

Quote
> Hi,

> I'm currently rewriting an application of mine which reads IGES entities
> (LINES,ARCS,SPLINES,TEXT) and draws these entities to the screen.

> The way I used to do it was to write to the canvas of the mainform of the
> app.

> Is there a speed increase in using a TPaintbox as my canvas?

> Is it faster to write to an invisible bitmap then write this bit map to
the
> visible canvas??

> I'm looking for the fastest graphics possible using DELPHI 5.

> Any help would be appreciated.

> Thank you,
> Charles Gipe

Re:TPaintbox.Canvas or MainForm.Canvas faster???


I actually did a small benchmark on this actually. In response to the canvas
question - I found no difference between a form canvas and a paintbox
canvas. Using a heavy weight control like TImage shows huge difference. But
if I were you I would use a Paintbox so that you can mange your coordinates
easier rather than offsetting from the forms top left corner.
Quote
"David Lively" <no.s...@4.me> wrote in message

news:95nv3b$7jl6@bornews.inprise.com...
Quote
> Hmm.. A canvas is a canvas is a canvas, I think. I'm working on a vector
> tool that maintains the objects in a queue, draws them to a TBitmap, then
> Blt's the bitmap onto my control's canvas. This solves a flicker problem,
> but actually results in a decrease in speed due to the overhead from the
> extra BLT operation.

> To my knowledge, there should not be a difference in speed between a
> Paintbox's canvas and a form's canvas, unless the form's canvas contains
> controls. I'd recommed using either the paintbox or a custom control just
> for the sake of organization and maintenance, though.

> - D

> "Gipe Software Dev. Inc." <g...@kvi.net> wrote in message
> news:95nf31$ge913@bornews.inprise.com...
> > Hi,

> > I'm currently rewriting an application of mine which reads IGES entities
> > (LINES,ARCS,SPLINES,TEXT) and draws these entities to the screen.

> > The way I used to do it was to write to the canvas of the mainform of
the
> > app.

> > Is there a speed increase in using a TPaintbox as my canvas?

> > Is it faster to write to an invisible bitmap then write this bit map to
> the
> > visible canvas??

> > I'm looking for the fastest graphics possible using DELPHI 5.

> > Any help would be appreciated.

> > Thank you,
> > Charles Gipe

Other Threads