Loading a CBitmap directly from file system without requiring ::LoadBitmap
-
Hi there, I have to fill CImageList with bitmaps. Each bitmap represent a flag of a country. To do this one normally adds the bitmap files as resource, then :
CImageList allFlagsList;
CBitmap flagUSA;
flagUSA.LoadBitmap(IDFlagUSA);allFlagsList.Add(flagUSA);
CBitmap flagFrance;
flagFrance.LoadBitmap(IDFlagFrance);allFlagsList.Add(flagFrance);
..etc
Of course it becomes tedious to do this for all flags ( actually I already did it but want to refactor it for sake of my code!). However I can't find a way how to load a bmp image directly into a CBitmap object. Anyone knows ? Thanks in advance.
Push Framework - now released ! http://www.pushframework.com
-
Hi there, I have to fill CImageList with bitmaps. Each bitmap represent a flag of a country. To do this one normally adds the bitmap files as resource, then :
CImageList allFlagsList;
CBitmap flagUSA;
flagUSA.LoadBitmap(IDFlagUSA);allFlagsList.Add(flagUSA);
CBitmap flagFrance;
flagFrance.LoadBitmap(IDFlagFrance);allFlagsList.Add(flagFrance);
..etc
Of course it becomes tedious to do this for all flags ( actually I already did it but want to refactor it for sake of my code!). However I can't find a way how to load a bmp image directly into a CBitmap object. Anyone knows ? Thanks in advance.
Push Framework - now released ! http://www.pushframework.com
-
I'm not sure I understand your question, but if you are trying to load a bitmap from a file you can use LoadImage()[^].
Just say 'NO' to evaluated arguments for diadic functions! Ash
Thx for your will to help. That's what I was relying on, but this way I needed to get all flags in the resources which was tedious. I found this which solves my issue and maybe the one who would encontere the same situation : http://www.codeguru.com/cpp/g-m/bitmap/article.php/c1707
Push Framework - now released ! http://www.pushframework.com