Lazarus

Programming => Graphics and Multimedia => Graphics => Topic started by: wp on December 25, 2020, 01:57:42 pm

Title: Painting polygons on the Canvas
Post by: wp on December 25, 2020, 01:57:42 pm
I wrote a wiki article about drawing special polygons (self-intersecting, holes), it took me some time to find this out and maybe it is interesting to somebody out there: https://wiki.freepascal.org/Graphics_-_Working_with_TCanvas#Drawing_a_polygon
Title: Re: Painting polygons on the Canvas
Post by: Handoko on December 25, 2020, 02:00:31 pm
Thank you.
Title: Re: Painting polygons on the Canvas
Post by: circular on December 25, 2020, 04:47:01 pm
Interesting.  :)
Title: Re: Painting polygons on the Canvas
Post by: winni on December 25, 2020, 10:08:25 pm
Hi!

wp 's article was realy necessary.

But if you have to work with a lot of polygones - like map drawing - I would adwise the use of the BGRAbitmapPack.

Advantages:

With only one BGRAbitmap.DrawPolyGoneAntiAlias you can draw a MultiPolygon in one job.
You only have to separate the different polygons with a const named EmptyPointF

You can draw polygones and polygone holes in one job. The first have to be in the one direction of rotation, the second in the other. That's all.

On the pagan winter solstice feast of the old Rome.
Later adapted as christmas.

Winni
Title: Re: Painting polygons on the Canvas
Post by: lucamar on December 25, 2020, 11:09:46 pm
On the pagan winter solstice feast of the old Rome.
Later adapted as christmas.

O.T. but ... no. It's the old roman Festival of Mithras, not the solstice. Romans stopped celebrating the solstice (as a public feast) early after the foundation of Rome and where it existed it was in fact a week centered around the solstice itself (~ December 21st) so by the 25th it used to be already winding down. A friend who is a Dr. in History put me to rights, at long length  (shepherd kings <mumble, mumble> first republic <mumble, mumble> Silas <more mumble, mumble>), about that some years/xmases ago so I pass it on whenever I can ;D

Note also that calling pagan a feast of old Rome is somewhat misleading, since they were the ones who "invented" the word (after a similar Grrek term, IIRC) to refer to any not-really-a-citizen (of Rome), in the first place 8-)

Ok, let's get back On-Topic ;)
Title: Re: Painting polygons on the Canvas
Post by: winni on December 25, 2020, 11:39:54 pm
Hi!

Yes- writing in a language that is not mine. Trouble.

Mithras feast. But it was around the winter solstice.
Remember that the calendar was not as exact as today.
And the party was allways done on 25th of December.

Remember that the Julian Calendar was introduced something around 45 BC including
the leap year. With 0.001 year error. That took another 1600 years to make it exact.

And about Mithras: This divinity has a big history in Persia and came with Alexander to Greece. And then to Rome. To make it short.

Winni



Title: Re: Painting polygons on the Canvas
Post by: loaded on December 26, 2020, 07:35:12 pm
wp,
Multiple polygon drawing is a matter I have wondered before. Thank you, it was a good work.
TinyPortal © 2005-2018