Load bitmaps dynamically
-
How to load bitmpas dynamically? When i directly loaded into resources(IDB_BITMPA) my exe is occupying more size. Instead of that how can i load at run time from bitmap images (res\image.bmp)
If you're using
Win32 API
, you may useLoadImage
[^], for instanceHANDLE hMyBmp = LoadImage(NULL, _T("res\\image.bmp"), IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
On the other hand, if you're using
MFC/ATL
, have a look atCImage
class documentation [^], theLoad
method looks promising. :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
How to load bitmpas dynamically? When i directly loaded into resources(IDB_BITMPA) my exe is occupying more size. Instead of that how can i load at run time from bitmap images (res\image.bmp)
-
How to load bitmpas dynamically? When i directly loaded into resources(IDB_BITMPA) my exe is occupying more size. Instead of that how can i load at run time from bitmap images (res\image.bmp)
Have a look at these simple tutorials, about how to load and display bitmaps from file. http://www.functionx.com/visualc/bitmaps/DisplayFromFile.htm[^] http://www.functionx.com/visualc/views/DisplayBitmap.htm[^] Regards, Jijo.
_____________________________________________________ http://weseetips.com[^] Visual C++ tips and tricks. Updated daily.
-
How to load bitmpas dynamically? When i directly loaded into resources(IDB_BITMPA) my exe is occupying more size. Instead of that how can i load at run time from bitmap images (res\image.bmp)
You can use of CImage class: #include AtlImage.h CImage m; m.Load(_T("")); .... ...