HOWTO: How to Use CBitmapButton to Resize a Bitmap to Fit a Button (134421)
The information in this article applies to:
- The Microsoft Foundation Classes (MFC), when used with:
- Microsoft Visual C++ for Windows, 16-bit edition 1.5
- Microsoft Visual C++ for Windows, 16-bit edition 1.51
- Microsoft Visual C++ for Windows, 16-bit edition 1.52
- Microsoft Visual C++, 32-bit Editions 2.0
- Microsoft Visual C++, 32-bit Editions 2.1
- Microsoft Visual C++, 32-bit Editions 2.2
- Microsoft Visual C++, 32-bit Editions 4.0
- Microsoft Visual C++, 32-bit Editions 4.1
- Microsoft Visual C++, 32-bit Enterprise Edition 4.2
- Microsoft Visual C++, 32-bit Professional Edition 4.2
This article was previously published under Q134421 SUMMARY
You can override the default behavior of CBitmapButton so the bitmap sizes
to fit the button. How CBitmapButtons behave during initialization depends
on which function is used to load the bitmaps.
Function Behavior When used
AutoLoad() button sizes to bitmap button is in dialog box
LoadBitmaps() button remains at size button is in non-dialog
specified when created window
If you want the bitmap to stretch to fit the dimensions of the button you
create, you must override these functions:
CBitmapButton::AutoLoad()
CBitmapButton::DrawItem()
NOTE: You need only override AutoLoad() if you call it to initialize a
button.
Modification Type: | Major | Last Reviewed: | 12/9/2003 |
---|
Keywords: | kbBitmap kbButton kbcode kbCtrl kbhowto KbUIDesign KB134421 |
---|
|