C++ComponentsLanguage FeatureLearn C++

This Is How To Use Shape Components In A Windows C++ App

This Is How To Use Shape Components In A Windows C++ App

C++ Builder is a great IDE which comes with the FireMonkey UI framework. While Firemonkey is a powerful multi-platform UI framework which lets you create apps which work on desktop as well as mobile phones and tablets you can also use it to add many shape types to your C++ app on Windows.

TShape is the ancestor class to most other classes defined in the Objects unit. It defines the common behavior–methods and properties–for 2D graphic primitives. TShape objects cannot be used as stand-alone 2D components.

The base class for 2D graphic primitives–TLinesTRectanglesTPaths, and others. All these primitives inherit TControl and can be used in styles to construct controls.

The base class for 2D graphic primitives–TLinesTRectanglesTPaths, and others. All these primitives inherit TControl and can be used in styles to construct controls.

In C++ Builder you can directly create your own 3D objects, you can animate them on runtime. Viewport3D (TViewportd3D) component in C++ Builder FireMonkey projects is good to display many basic 3D Objects like Plane, Cube, Sphere, Cone, Plane, Ellipse3D etc. You can also easily load your 3D objects into Viewport3D by using Model3D (TModel3D).

Rectangle (TRectangle)

TRectangle defines 2D rectangles with customized corners. It inherits TControl and can be used in styles to construct controls. You can create a rectangle shape as below,

At the end of usage, we should free this rectangle from the memory as below,

Ellipse (TEllipse)

TEllipse defines 2D ellipses. It inherits TControl and can be used in styles to construct controls.

At the end usage, we should free this rectangle from the memory as below,

Other 2D objects are about same as in given examples above.

Did you know you can download a free trial of C++ Builder?

close

Oh hi there 👋
It’s nice to meet you.

Sign up to receive awesome C++ content in your inbox, every day.

We don’t spam! Read our privacy policy for more info.

About author

33+ years of coding with more than 30+ programming languages, mostly C++ on Windows, Android, Mac-OS, iOS, Linux and some other operating systems. Dr. Yilmaz Yoru was born in 1974, Eskisehir-Turkey. He graduated from the department of Mechanical Engineering of Eskisehir Osmangazi University in 1997. One year later he started to work in the same university as an assistant. He received his MSc and PhD degrees from the same department of the same university. He has married and he is a father of a son. Some of his interests are Programming, Thermodynamics, Fluid Mechanics and Artificial Intelligence. He also likes the graphical 2D & 3D design and high-end innovations.
Related posts
C++Learn C++

How To Make Your C++ Compiler Fly Much Faster

C++C++11C++14C++17Introduction to C++Learn C++

This Is How To Join Two Wide Strings In Modern C++ Software

C++C++11C++14C++17Learn C++

How To Use The All-Powerful swscanf function In Your C++ App

C++ComponentsLanguage FeatureLearn C++

How To Use A Sharpen Effect in C+ Software On Windows?