Thanks bplus for the excellent example.
It got me thinking about BF option; why is it there? It seems unneeded.
After experimenting, I found that the BF option, even with single line makes drawing the line 5x faster!
Against common sense I added the BF option to the line statements in my code and surprise... it was 5x faster also.
Now it has the same speed (even a tiny bit faster) as your routine:
It got me thinking about BF option; why is it there? It seems unneeded.
After experimenting, I found that the BF option, even with single line makes drawing the line 5x faster!
Against common sense I added the BF option to the line statements in my code and surprise... it was 5x faster also.
Now it has the same speed (even a tiny bit faster) as your routine:
Code: (Select All)
Sub fCircle (x%, y%, r%, c~&)
'Filled Circle: Transparency OK & >20x faster then Paint
r2& = r% * r%
xx% = Sqr(r2& - y2&): Line (x% - xx%, y%)-(x% + xx%, y%), c~&, BF
For yy% = 1 To r%
y2& = yy% * yy%: xx% = Sqr(r2& - y2&)
Line (x% - xx%, y% - yy%)-(x% + xx%, y% - yy%), c~&, BF
Line (x% - xx%, y% + yy%)-(x% + xx%, y% + yy%), c~&, BF
Next yy%
End Sub
45y and 2M lines of MBASIC>BASICA>QBASIC>QBX>QB64 experience