DIBLIST.CPP
资源名称:SNMP范例源代码.zip [点击查看]
上传用户:shgx688
上传日期:2009-12-27
资源大小:855k
文件大小:1k
源码类别:
SNMP编程
开发平台:
MultiPlatform
- // DibList.cpp: implementation of the CDibList class.
- //
- //////////////////////////////////////////////////////////////////////
- #include "stdafx.h"
- #include "OAM.h"
- #include "DibList.h"
- #ifdef _DEBUG
- #undef THIS_FILE
- static char THIS_FILE[]=__FILE__;
- #define new DEBUG_NEW
- #endif
- //////////////////////////////////////////////////////////////////////
- // Construction/Destruction
- //////////////////////////////////////////////////////////////////////
- CDibList::CDibList()
- {
- m_nEveryCx = m_nEveryCy = 0;
- }
- CDibList::~CDibList()
- {
- }
- BOOL CDibList::Load(LPCSTR strFileName,int nImages,COLORREF bkClr)
- {
- DeleteImageList();
- m_nEveryCx = m_nEveryCy = 0;
- HBITMAP hBitmap;
- hBitmap = (HBITMAP)LoadImage(AfxGetInstanceHandle(),strFileName,
- IMAGE_BITMAP,0,0,LR_LOADFROMFILE|LR_CREATEDIBSECTION);
- if(hBitmap == NULL)
- return FALSE;
- BITMAP bm;
- CBitmap * pBitmap = CBitmap::FromHandle(hBitmap);
- GetObject(hBitmap,sizeof(BITMAP),&bm);
- if(Create(bm.bmWidth/nImages, bm.bmHeight, ILC_COLORDDB|ILC_MASK, nImages, 1)
- && Add(pBitmap, bkClr) != -1)
- {
- m_nEveryCx = bm.bmWidth/nImages;
- m_nEveryCy = bm.bmHeight;
- return TRUE;
- }
- return FALSE;
- }
- CSize CDibList::GetEverySize()
- {
- return CSize(m_nEveryCx,m_nEveryCy);
- }
- void CDibList::DrawEx(CDC *pdc, int nImage, CRect rect, UINT nStyle)
- {
- }