摘要
本文首先介绍了BMP的文件结构,然后采用加载资源位图,调用视图类中的成员函数OnDraw(CDC*pDC)的方法来显示位图。但该方法缺乏灵活性,所显示的图片的大小也有一定的限制。为实现图片的伸缩显示,提出了在实际设备中显示位图的思路。遵循这个思路,在基于MFC的VC程序中给出具体实例,即通过调用MFC的设备环境类CDC的成员函数BitBlt()或成员函数StretchBlt()来实现BMP位图的缩放显示。
BMP is the abbreviation of BitMap,and it's a format that all graphic image software support in the Windows environment. This article describes the structure of the BMP first, and then displays the bitmap by loading the resource bitmap and calling the classview's member function OnDraw (CDC * pDC).But the method lacks flexibility,and the size of the displayed image also has certain limitation. So the idea of displaying a bitmap in the actual equipment is proposed to achieve the stretching picture's show. Follow this idea, giving a specific example in the VC program based on MFC,that is,calling the CDC member function BitBlt() or StretchBlt () of MFC device class to achieve BMP's flexible display.
出处
《电子测试》
2009年第12期27-30,共4页
Electronic Test