在vc中自建操作bmp位图文件的类(Classes that build BMP bitmap files in VC).docVIP

  • 7
  • 0
  • 约1.12万字
  • 约 20页
  • 2017-10-06 发布于河南
  • 举报

在vc中自建操作bmp位图文件的类(Classes that build BMP bitmap files in VC).doc

在vc中自建操作bmp位图文件的类(Classes that build BMP bitmap files in VC)

在vc中自建操作bmp位图文件的类(Classes that build BMP bitmap files in VC) Classes that build BMP bitmap files in VC Xian Wanshan Software Co. Ltd. Jiatun Programmers who have programming experience know that to make the applications interface beautiful and inevitable Using lots of bitmaps. The popular visual programming tools now provide good use of bitmaps The support, known as the three visual development tools of VB, VC, and Delphi, encapsulates bitmaps by encapsulating them Objects provide good support for bitmap usage: VB provides two powerful objects: PictureBox and Image make it very easy to load and display bitmaps by using them. Delphi also provides a bitmap object: TImage, its function and usage, and VB Image is similar. In VC, you use the device dependent class CDC and the GDI object class CBitmap to complete Bitmap operation. However, in VC, using the CBitmap class must load the BMP bitmap into the resource, Then, using the member functions of class CBitmap, use it to operate through member functions of the CDC class It. There are two drawbacks to doing this: loading a bitmap into a resource causes an executable file to increase and is detrimental In software release; can only use limited bitmap in the resource, unable to select other bitmap. And The BMP bitmap file is saved in DIB (device independent bitmap), and the BMP bitmap is loaded into the resource Is converted to DDB (device related bitmaps), and class CBitmap is a series of DDB operations The API function is encapsulated and used with some limitations, so that DIB can be independent Platform characteristics. To make up for two deficiencies in using a resource bitmap, you must use the BMP bitmap directly Document. The example of VC provides a way to read and display BMP bitmap files, but use them Quite troublesome. First, use the API function GlobalAlloc to allocate memory and create the HDIB bitmap Handle, all operations can only read and write memory directly, and then through StrechDIBits and The SetDIBsT

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档