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.


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 was born in 1974, Eskisehir-Turkey, started coding in college and graduated from the department of Mechanical Engineering of Eskisehir Osmangazi University in 1997. He worked as a research assistant at the same university for more than 10 years. He received his MSc and PhD degrees from the same department at the same university. Since 2012, he is the founder and CEO of Esenja LLC Company. He has married and he is a father of a son. Some of his interests are Programming, Thermodynamics, Fluid Mechanics, Artificial Intelligence, 2D & 3D Designs, and high-end innovations.
Related posts
C++C++11C++14C++17C++20Learn C++Syntax

What Is Deleted Implicitly-declared Copy Assignment Operator In C++?

C++C++11C++14C++17C++20Learn C++Syntax

What Is A Forced (Default) Copy Assignment Operator In Modern C++

C++C++11C++14C++17C++20Learn C++Syntax

What is Implicitly-declared Copy Assignment Operator In C++?

C++C++11C++14C++17C++20Learn C++Syntax

What is Avoiding Implicit Copy Assignment In C++?