Visual C++ and MFC Programming 2nd Edition

(Martin Jones) #1

Chapter 3: Windows Resources Visual C++ and MFC Fundamentals


3.2.2 Icons Design............................................................................................


So far, we were not specifying an icon for our window. Therefore, Visual C++ was using
a default icon for the title bar:

This icon is 16x16 pixels. If you want to display a custom icon on the title bar, you can
design your own 16x16 pixel icon as a resource.

If you want your application to display a big icon in the thumbnails or tiles views of
Windows Explorer or My Computer, design an icon with a 32x32 pixel dimension and
using the same name as the 16x16 pixel icon.

To create an icon or add a new one, you can right-click the project name in the Solution
Explorer, position the mouse on Add and click Add Resource. This displays the Add
Resource dialog box where you can double-click Icon.

To design an icon, you use a set of tools that allow you to draw lines, curves, points, etc.
These tools are available from the Graphics toolbar. Each tool is called to by the text of
its tool tip. To know the name of a tool, position the mouse on it for a few seconds.

Tool Name Description

Rectangle Selection^ Used as an outline to select a rectangular area^

Irregular Selection^

Used to draw freehand selection but a rectangle is
drawn from the starting selection to the end

Select Color^ Used to select a color^
Erase Used to erase color on an area

Fill^

Fills a section with a color, only the same pixels with
the same color are filled

Magnify^ Zooms an area of the picture^
Pencil Draws lines

Brush Used to draw predefined lines, small squares or large
lines

Airbrush^ Assigns a color to random pixels on the picture^

Line^ Used to draw a line^

Curve^ Draws a curve in a multiple step process^
Text Allows drawing text

Rectangle Used to draw a rectangular shape specifying only the
border color

Outlined Rectangle Draws a rectangle with one color for the border (pen)
and another color for the inside (brush)

Filled Rectangle

Used to draw a rectangle filling it with an interior color
while the border color is ignored

Round Rectangle^

Used to draw a round rectangular shape specifying only
the border color
Free download pdf