简体   繁体   English

从资源ID创建一个CBitmap

[英]Create a CBitmap from Resources ID

I need to fill a CImageList with a number of bitmaps which are stored in separate bmp files (rather than as a single bmp with numerous parts). 我需要用多个位图填充CImageList ,这些位图存储在单独的bmp文件中(而不是作为一个包含很多部分的bmp)。 I assume I need to create a CBitmap so I can call the Add method of CImageList . 我假设我需要创建一个CBitmap以便可以调用CImageListAdd方法。 So how might one create a CBitmap object using only MFC Resource IDs? 那么,如何仅使用MFC资源ID创建一个CBitmap对象呢?

You just need to use the method CBitmap::LoadBitmap . 您只需要使用CBitmap :: LoadBitmap方法。

You can either load the bitmap from the file or from resources. 您可以从文件或资源中加载位图。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM