Maybe I can contribute my 2 pennies worth.....
Play a bit with this code, it works for me:
'********************
GraphFront=newPicture(CanvasGraph.width,CanvasGraph.height,16) 'This is the
Graphs
GraphFront.graphics.ForeColor=GraphBackColor 'if you want color
GraphFront.graphics.FillRect 0,0,GraphFront.width,GraphFront.height 'fill
with color
'''''''''''''''
'your code here, i.e:
'GraphFront.graphics.drawline (GX1),(GY2),(GX2),(GY2)
'''''''''''''
CanvasGraph.graphics.DrawPicture GraphFront,0,0 'Draw modified (buffered)
picture to Graphcanvas
'**********************
Also note that there is a huge difference in speed depending on colordepth,
obviously 32bit is the slowest.
A quick test showed that at
32bit I got 41 frames/sec
8bit I got 122 frames/sec
1bit I got 583 frames/sec
Marc-Hendrik Bremer wrote:
> Hello,
>
> I have some methods painting some graphics-stuff in a canvas. That works
> fine but is quite slow.
> Now I want to use an extra buffer as mentioned here and in the docs. I have
> "Offg" (of class picture) as a property of my canvas-class and build it with
> a NewPicture(x,y,0) in an early method. But if I try to pass Offg.graphics
> to my painting methods, the Parameter they get is always "Nil" and I (of
> course) get an exception when they try to use the graphics-methods on it.
> Passing the parameter ByRef did not work either.
>
> What am I doing wrong?
>
> Any help would be realy nice!
>
> Regards,
>
> Marc-Hendrik
--
*******************************************
VISIT MY HOME PAGE:
<http://home.online.no/~eikarlse/index.htm>
LAST UPDATED: 23/08/2003
*******************************************
Regards
Eirik Karlsen
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://www.realsoftware.com/listarchives/lists.html>
|