I had the same thought but I didn't express it because at the time I had icing all over my fingers.wilbert wrote:it's a bit strange because the VectorDrawing library and this gdrawing.pbi file both seem to use GDI+
slow drawing
- netmaestro
- PureBasic Bullfrog

- Posts: 8453
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Re: slow drawing
BERESHEIT
Re: slow drawing
I agree too, but GDI+, exactly as Scintilla in the past, has an internal feature which asks anything in the network.
Re: slow drawing
I don't know if it is slower or faster, but Danilo's examples are a big help.
I still have so much to discover and learn.
I still have so much to discover and learn.
Re: slow drawing
Personnally, I just made a remover of the native Norton anti-virus installer... And GDI strangely lost this surprising latency.
Re: slow drawing comparing
addpathline and AddPathCircle are the slowest.
The time is changeable ?
discovered some more,it is strange that drawing a circle seems faster than drawing a line
The time is changeable ?
discovered some more,it is strange that drawing a circle seems faster than drawing a line
Code: Select all
OpenWindow(0,0,0,1800,900,"")
CanvasGadget(0, 0,0,1800,900)
x.d = 500
y.d =400
start.q = ElapsedMilliseconds()
;speedtest drawing arc
StartVectorDrawing(CanvasVectorOutput(0))
For i=1 To 25000
x=400:y=300:a=100:b=200
MovePathCursor(x,y)
; AddPathLine(a,b);613ms
AddPathCircle(400,300,100,0,330);2789ms
VectorSourceColor(0)
StrokePath(2)
Next
StopVectorDrawing()
finish.q = ElapsedMilliseconds()
MessageRequester("Time Taken for 25K lines drawn:", Str(finish-start))
;-------------------------------------------------------------------------
;speedtest with linxy
start.q = ElapsedMilliseconds()
StartDrawing(CanvasOutput(0))
For i=1 To 25000
x=400:y=300:a=100:b=200 ;46ms
LineXY(x,y,a,b,0)
Next
StopDrawing()
finish.q = ElapsedMilliseconds()
MessageRequester("Time Taken for 25K lines drawn:", Str(finish-start))
;--------------------------------------------------------------------------
;speedtest for arcs with linexy
x_old.d=0
y_old.d=0
x1.d=0:y1.d=0
start.q = ElapsedMilliseconds()
StartDrawing(CanvasOutput(0))
LineXY(100,100,1000,100,0)
radius=200
start_arc=0: arc=start_arc:end_arc=290
x1=Cos(Radian(arc))*radius
y1=-Sin(Radian(arc))*radius ;negative for the quadrant
x_old=x1:y_old=y1
For i=1 To 25000 ; arcs =4 to 18ms time is changeable ?
While arc <=end_arc
x1=Cos(Radian(arc))*radius
y1=-Sin(Radian(arc))*radius
LineXY(x+x_old,y+y_old,x+x1,y+y1,0)
x_old=x1:y_old=y1:arc=arc+1
Wend
Next
StopDrawing()
finish.q = ElapsedMilliseconds()
MessageRequester("Time Taken for 25K lines drawn:", Str(finish-start))
Repeat:Until WaitWindowEvent()=#PB_Event_CloseWindow
Re: slow drawing
Hi,
but for your application it should really be fast enough.
What do you want to do with many thousands of lines and circles in a split second ?
There are beautiful benchmark programs, check them out and have fun
Best Regards Saki
but for your application it should really be fast enough.
What do you want to do with many thousands of lines and circles in a split second ?
There are beautiful benchmark programs, check them out and have fun
Best Regards Saki
地球上の平和
Re: slow drawing
Saki,
I try to make a gcode viewer,a gcode file can contain hundreds of thousands of lines.
I would like such a file on the screen so I can rotate it, zoom, move. But I still have a lot to discover.
I'm also trying to find something to do this in 3D.
I try to make a gcode viewer,a gcode file can contain hundreds of thousands of lines.
I would like such a file on the screen so I can rotate it, zoom, move. But I still have a lot to discover.
I'm also trying to find something to do this in 3D.
Re: slow drawing
Are you planning to convert/interpret the gcode into data for the rendering and then store this separately so that only the rendering data has to be used for rotations, zooming, etc without the need to keep referencing the gcode for each rendering?ludoke wrote:Saki,
I try to make a gcode viewer,a gcode file can contain hundreds of thousands of lines.
I would like such a file on the screen so I can rotate it, zoom, move. But I still have a lot to discover.
I'm also trying to find something to do this in 3D.
Re: slow drawing
It's probably no coincidence that most gcode viewers use OpenGL, or some such, for this kind og thing, although this could be for cross-platform reasons if nothing else. If you are showing toolpaths and the like then you would likely wish to throw up different orientations and, well, I wouldn't have thought that the vector library would be the way to go. Just depends how far you need to go down this path?ludoke wrote:Saki,
I try to make a gcode viewer,a gcode file can contain hundreds of thousands of lines.
I would like such a file on the screen so I can rotate it, zoom, move. But I still have a lot to discover.
I'm also trying to find something to do this in 3D.
I may look like a mule, but I'm not a complete ass.

