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?

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.


Reduce development time and get to market faster with RAD Studio, Delphi, or C++Builder.
Design. Code. Compile. Deploy.
Start Free Trial

Free C++Builder Community Edition

About author

Dr. Yilmaz Yoru has 35+ years of coding with more than 30+ programming languages, mostly C++ on Windows, Android, Mac-OS, iOS, Linux, and some other operating systems. He graduated and received his MSc and PhD degrees from the Department of Mechanical Engineering of Eskisehir Osmangazi University. He is the founder and CEO of ESENJA LLC Company. His interests are Programming, Thermodynamics, Fluid Mechanics, Artificial Intelligence, 2D & 3D Designs, and high-end innovations.
Related posts
C++C++11C++14C++17C++20Introduction to C++Learn C++

Learn Copy Constructors in C++ Classes

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

Learn How To Use Types Of Destructors In C++?

C++C++11C++14Learn C++Syntax

How To Convert u32string To A wstring In C++

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

How To Learn The Move Constructors In Modern C++?