Environment:
CBitmapPicture is derived from CBitmap. It allows the user to load jpg, gif, bmp, and dib formats from a file or from the resouce and store them as a CBitmap object.
Public Operations
- Load from file given supplied path
BOOL Load(CString sFilePathName);
BOOL Load(UINT ResourceName, CString ResourceType);
BOOL SelectFileAndLoad();
CBitmapPicture uses the IPicture interface just as Internet Explorer does to load jpg and gif files. The IPicture interface is then converted to a bitmap interface.
CBitmpaPicture utilizes code from:
class CPicture—Author: Dr. Yovav Gad, EMail: Sources@SuperMain.com, Web: www.SuperMain.com
function LoadBMPImage—Author: Zafir Anjum
Example Usage
- Load a job from resource; then Select it into CStatic Image object m_Display
Picture.Load(IDR_JPG_SPACE31,"JPG") m_Display.SetBitmap((HBITMAP)Picture.GetSafeHandle());
if(Picture.SelectFileAndLoad()) m_Display.SetBitmap((HBITMAP)Picture.GetSafeHandle());