Chapter 3. QPainter and 2D Graphics

In this chapter, we will cover the following recipes:

  • Drawing basic shapes on screen
  • Exporting shapes to an SVG file
  • Coordinate transformation
  • Displaying images on screen
  • Applying image effects to graphics
  • Creating a basic paint program
  • 2D Canvas in QML

Introduction

In this chapter, we will learn how to render 2D graphics on screen with Qt. Internally, Qt uses a low-level class called QPainter to render its widgets on the main window. Qt allows us to access and use the QPainter class for drawing vector graphics, text, 2D images, and even 3D graphics. You can make use of the QPainter class to create your own custom widgets or to create programs that rely heavily on computer graphics rendering such as video games, photo editors, 3D modeling tools, and so on.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.73.207