Get access to over 100 FireMonkey cross platform samples for Android, IOS, OSX, Windows, and Linux!

AndroidAppmethodCode SnippetDelphiDemoFiremonkeyIOSOSXWindows

Polygon Morphing And Line Intersection With Delphi XE6 Firemonkey On Windows And OSX

Delphi XE6 Firemonkey Morph A Polygon And Intersect A LineDeveloper zedalaye has a project up on Github which demonstrates how to intersect a polygon that is morphing in real time with a line. The original project was for Delphi XE2 but I have updated the project for Delphi XE6 Firemonkey. I was able to get it working on Windows in XE6 but under Android there is a painting issue. Basically it has a polygon shape in the center of a TPaintBox. There is a line that rotates from the center to the edges of the box and wherever the line intersects with the polygon a point is drawn. At the same time the polygon is morphing it’s shape so the point where the line is intersecting the polygon is constantly changing. There is some interesting code in here including two custom classes that derive from the TAnimation component for handling the animation of the point and the polygon. Take a look at the two objects here:

And here is the intersect function which will give you the TPointF where two lines intersect.

Head over and check out the source code for the polygon morphing and line intersection project on Github.

Or download the updated polygon morphing and line intersection project for Delphi XE6 Firemonkey.

Have Delphi Firemonkey questions? Ask and get answers on StackOverflow.

Related posts
AndroidC++BuilderCode SnippetDelphiDemoFiremonkeyIOSOSXShowcaseWindows

Powerful Cross Platform Email App Sample In Delphi 10.4.1 FireMonkey For Android And IOS


Significant Update Available For Delphi FireMonkey 10.4.1 On Android, IOS, OSX, Windows, And Linux


Professional SVG Icon Image List For Delphi 10.4 FireMonkey On Windows


Top Tips And Tricks To Speed Up Development With Delphi 10.4 FireMonkey On Android and IOS

Sign up for our Newsletter and
stay informed

Leave a Reply