
Add Windows Resize Icons #35
Chapter 5, Windows, Dialogs, and Frames
|
185
HACK
Next, paint the white squares: one in the first row, two in the second, and
three in the third. Notice that the white squares are offset by one pixel
because the column and row variables (
firstRow
,
secondRow
, etc.) reference
the gray squares. These squares provide the 3D effect.
//first row
draw3dSquare(g, firstColumn+1, thirdRow+1);
//second row
draw3dSquare(g, secondColumn+1, secondRow+1);
draw3dSquare(g, secondColumn+1, thirdRow+1);
//third row
draw3dSquare(g, thirdColumn+1, firstRow+1);
draw3dSquare(g, thirdColumn+1, secondRow+1);
draw3dSquare(g, thirdColumn+1, thirdRow+1);
Finally, paint the gray squares on top of the white squares:
//first row
drawSquare(g, firstColumn, thirdRow);
//second row
drawSquare(g, secondColumn, secondRow);
drawSquare(g, secondColumn, thirdRow);
//third row
drawSquare(g, thirdColumn, firstRow);
drawSquare(g, thirdColumn, secondRow);
drawSquare(g, thirdColumn, thirdRow);
The Office Icon
Figure 5-5 shows the MS Office corner icon in detail.
Figure 5-5. The Windows MS Office icon zoomed in