[Lazarus] Fastest way to draw

Duncan Parsons D.Parsons at seamsltd.com
Fri May 21 16:53:24 CEST 2010


From: Brad Campbell [mailto:brad at wasp.net.au] 
Sent: 21 May 2010 15:38

>Mattias Gaertner wrote:
>> As memory image you can use TBitmap which has comfortable fonts, but 
>> is not the fastest.
>> 
>> Or you can use fpcanvas (it comes with fpc). See here 
>>
http://wiki.lazarus.freepascal.org/Developing_with_Graphics#Drawing_wi
>> thout_LCL
>> You can tune it quite a lot. 
>> 
>> If you use lazarus 0.9.29 you can use aggpas. The package can be
found 
>> in lazarus/components/aggpas. For examples in 
>> components/aggpas/lazarus/example/AggPasInLCLDemo1.lpi.
>> Aggpas is completely written in pascal, quite fast and the results
are 
>> the same on all platforms (as always: fonts are a problem).
>> 
>> And finally you can use opengl - for example via the TOpenglControl.
>
>Cheers for all that Mattias. I appreciate then leads. aggpas looks
really cool. I'll get it 
>benchmarked against my current stuff in the next day or so.
>
>>> Has anyone done anything similar?
>> 
>> No. You are the first.
>
>Righto, I'll be sure to post my code when I've got it fast enough then.
>
>Regards,
>Brad


There's GR32 as well, which now has FPC/Laz compatibility.
http://www.graphics32.org/

Overall, the best way to do that sort of thing is to have a bitmap in
memory (either loaded from a file, or drawn on application start) then
when doing what's needed copy/draw the background, then draw the
additional lines. I've done this sort of thing in realtime in audio/VST
programming, sometimes using Peter Morris's DIB controls, and sometimes
GR32. AggPas has come on since I last tried it a few years ago, and
could also be a good choice as suggested.

:-)

DSP




More information about the Lazarus mailing list