C++C++11C++14C++17Code SnippetLanguage FeatureLearn C++

Quickly Learn How To Use Canvas Drawing In C++ On Windows

In C++ Builder, it is easy to draw images on Bitmaps by using Canvas property and methods to draw, Canvas can be used on both VCL and FMX applications. Canvas provides an abstract drawing space for objects that must render their own images. TCanvas provides properties, events, and methods that assist in creating an image by:

  • Specifying the type of brush, stroke, and font to use.
  • Drawing and filling a variety of shapes and lines.
  • Writing text.
  • Rendering graphic images.
  • Enabling a response to changes in the current image.

In C++ Builder FireMonkey projects, Canvas requires BeginScene() and EndScene() Methods to edit that memory area faster. We can use Canvas property of any component. Here below all samples are about Canvas of Bitmaps. Canvas of Bitmaps can be used to draw inside and all drawings should be done between these methods as below;

General usage of Canvas of a Bitmap
Using Bitmap allows you to modify canvas while you can able to show this as a Image Bitmap, you can also Load or Save this bitmap easily. Please read this article about Bitmap Operations in C++ Builder (FireMonkey).

Colors, Pen and Paper Color in Canvas

Drawing Lines into Canvas

Getting and Drawing Pixels into Canvas

Drawing Rectangles into Canvas

Drawing Circles and Ellipses into Canvas

Drawing Texts in to Canvas

Drawing Bitmap into Canvas of another Bitmap

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

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++20Learn C++

What Is The Priority Queue (std::priority_queue) In Modern C++?

C++C++11C++14C++17C++20

What Is The Stack (std::stack) In Modern C++?

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

What Is The Queue (std::queue) In Modern C++?

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

What Are The Logical Operation Metafunctions In Modern C++?

Worth reading...
Top 6 C++ IDEs For Building Native Windows Apps In 2020