home | |||
links |
|
||
developer's mag main page article part 1 part 2 part 3 part 4 part 5 |
4 - Drawing on Your Image KnowledgeFor more flexibility, however, you may want to use the DrawImage command:
Notice this prototype includes a number of assignments - in C++, these are optional parameters, and are supplied to the compiler if you don't provide any. With these, the function calls
would both compile correctly, and would use the default parameters to fill in the unspecified values. Another drawing variation is DrawTiledImage(), which is virtually the same as DrawImage(), except for the addition of destination height and width - the image is tiled to fit this area, and so is useful for background drawing. The COLOR values foreground and background are used when drawing 2 color images. Normally the background and foreground Window colors are used for these, but you can change them to draw the one and zero bits in the image in different colors. By default, the source coordinate values srcx, srcy, srcwidth and srcheight copy the whole bitmap. You can adjust it to do partial copies; for example, using a single bitmap for a card deck, and copying only individual cards. Previous Section Next Section |
||
Copyright © 2001-2006 ebmDevMag.com - Legal Notice |