PostponeRedraw

Q&A for Visual Basic, Visual Basic .NET, and PowerBasic developers using DPlot
Post Reply
Bercic
Posts: 27
Joined: Mon May 17, 2004 6:44 am
Location: Slovenia

PostponeRedraw

Post by Bercic »

Dear Mr. David,

I am trying to prevent that Dplot redraw plot after addition of each new curve by using PostponeRedraw() command. Please could you advice me how to correct the following code in order to get desired effect or describe where PostponeRedraw command should be placed in order to prevent intermediate redrawing?

FOR j=curvestart TO curveend
count=count+1
ret=DPlot_Command(DocNum, "[PostponeRedraw()][SelectCurve(" & STR$(j)& ")][MultipleYAxes(0,0,0)]")
ret = DPlot_AddData( DocNum, %DATA_XYXY, yalldata,J,xdata(1),dataLeft(1+yalldata*(count-1)))
DocNum=ret
NEXT

Best regards, Gorazd
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

Unfortunately PostponeRedraw doesn't do anything with DPlot_AddData. But since you apparently don't want the plot updated until you're done, this should work:

Code: Select all

ret=DPlot_Command(0,"[AppHide()]")
FOR j=curvestart TO curveend 
count=count+1 
ret = DPlot_AddData( DocNum, %DATA_XYXY, yalldata,J,xdata(1),dataLeft(1+yalldata*(count-1))) 
DocNum=ret 
NEXT 
ret=DPlot_Command(0,"[AppShow()]")
Unless you're plotting 100's of thousands of points, DPlot won't actually have time to hide itself. But the plot won't be updated and you should see a significant increase in performance.
Visualize Your Data
support@dplot.com
Bercic
Posts: 27
Joined: Mon May 17, 2004 6:44 am
Location: Slovenia

Post by Bercic »

Dear David thanks for prompt response and useful information about the way how to temporary prevent »flashing« of DPlot window.

Gorazd - frequent DPlot user. I use DPlot daily for quick analysis and presentation of experimental and simulated data.
Post Reply