Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fast filled circle
#7
(11-26-2022, 11:13 PM)mdijkens Wrote: 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:
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

Ah very interesting! Thanks I like less LOC whenever it makes sense.
  724  855  599  923  575  468  400  206  147  564  878  823  652  556 bxor cross forever
Reply


Messages In This Thread
Fast filled circle - by mdijkens - 11-26-2022, 03:20 PM
RE: Fast filled circle - by CharlieJV - 11-26-2022, 03:58 PM
RE: Fast filled circle - by bplus - 11-26-2022, 04:19 PM
RE: Fast filled circle - by dbox - 11-26-2022, 10:43 PM
RE: Fast filled circle - by bplus - 11-26-2022, 10:54 PM
RE: Fast filled circle - by mdijkens - 11-26-2022, 11:13 PM
RE: Fast filled circle - by bplus - 11-26-2022, 11:29 PM
RE: Fast filled circle - by SMcNeill - 11-27-2022, 01:44 AM
RE: Fast filled circle - by SMcNeill - 11-27-2022, 01:46 AM
RE: Fast filled circle - by gaslouk - 11-27-2022, 04:50 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Fast Primes SMcNeill 17 3,901 06-06-2024, 04:44 AM
Last Post: eoredson
  polyFT - draw filled polygons James D Jarvis 5 1,323 08-22-2023, 08:47 PM
Last Post: johnno56
  fhex ... a Filled Hex James D Jarvis 2 965 08-19-2023, 08:13 PM
Last Post: James D Jarvis
  Mod'ing a classic- partial circle fill OldMoses 6 1,334 01-17-2023, 07:11 PM
Last Post: bplus

Forum Jump:


Users browsing this thread: 1 Guest(s)