17.4 UNIFORM LOOK AND FEEL WITH OBJECT ORIENTATION

Object orientation can bring lot of ease and comfort in graphical programs too. Let us have a fresh look at graphics programs.

To see something on the screen of a monitor, we need a rectangular area. Let us call it as a canvas. We will be drawing on this canvas. Naturally, canvas will have dimensions. For practical considerations, canvas will be rectangular. We will have to put some background colour. The canvas will be painted by the background colour. In general, background colour will not change during the life of our program.

For drawing, we need drawing colour which is called foreground colour. We should be able to set this colour from time to time as per our need. The first thing is drawing ...

Get Object Oriented Programming with C++, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.