<b>从系统中获得指定资源图象</b>[VC/C++编程]
本文“<b>从系统中获得指定资源图象</b>[VC/C++编程]”是由七道奇为您精心收集,来源于网络转载,文章版权归文章作者所有,本站不对其观点以及内容做任何评价,请读者自行判断,以下是其具体内容:
在Winuser.h中定义了一些系统常用的资源,比方对话框的图标,某些按钮上的图象等.
以下是部份OEM资源序号和一些尺度ICON的ID:
//---------------------------------------------------------------------------
// OEM Resource Ordinal Numbers
#define OBM_OLD_CLOSE 32767
#define OBM_SIZE 32766
#define OBM_OLD_UPARROW 32765
#define OBM_OLD_DNARROW 32764
#define OBM_OLD_RGARROW 32763
#define OBM_OLD_LFARROW 32762
#define OBM_BTSIZE 32761
#define OBM_CHECK 32760
#define OBM_CHECKBOXES 32759
#define OBM_BTNCORNERS 32758
#define OBM_OLD_REDUCE 32757
#define OBM_OLD_ZOOM 32756
#define OBM_OLD_RESTORE 32755
#define OBM_CLOSE 32754
#define OBM_UPARROW 32753
#define OBM_DNARROW 32752
#define OBM_RGARROW 32751
#define OBM_LFARROW 32750
#define OBM_REDUCE 32749
#define OBM_ZOOM 32748
#define OBM_RESTORE 32747
#define OBM_REDUCED 32746
#define OBM_ZOOMD 32745
#define OBM_RESTORED 32744
#define OBM_UPARROWD 32743
#define OBM_DNARROWD 32742
#define OBM_RGARROWD 32741
#define OBM_LFARROWD 32740
#define OBM_MNARROW 32739
#define OBM_COMBO 32738
#define OBM_UPARROWI 32737
#define OBM_DNARROWI 32736
#define OBM_RGARROWI 32735
#define OBM_LFARROWI 32734
// Standard Icon IDs
#define IDI_APPLICATION MAKEINTRESOURCE(32512)
#define IDI_HAND MAKEINTRESOURCE(32513)
#define IDI_QUESTION MAKEINTRESOURCE(32514)
#define IDI_EXCLAMATION MAKEINTRESOURCE(32515)
#define IDI_ASTERISK MAKEINTRESOURCE(32516)
#define IDI_WINLOGO MAKEINTRESOURCE(32517)
我们可以通过LoadBitmap从系统中获得指定资源图象:
void __fastcall TMainForm::Button1Click(TObject *Sender)
{
for(int i=0; i<30; i++)
{
HBITMAP hBitmap = ::LoadBitmap(NULL, MAKEINTRESOURCE(32734 + i));
TImage *img = new TImage(this);
img->Picture->Bitmap->Handle = hBitmap;
Canvas->Draw(9 + i *16, 9, img->Picture->Bitmap);
delete img;
DeleteObject(hBitmap);
}
for(int i=0; i<5; i++)
{
HICON hIcon = ::LoadIcon(NULL, MAKEINTRESOURCE(32512 + i));
TImage *img = new TImage(this);
img->Picture->Icon->Handle = hIcon;
Canvas->Draw(10 + i *32, 50, img->Picture->Icon);
delete img;
DeleteObject(hIcon);
}
}
//---------------------------------------------------------------------------
以上是“<b>从系统中获得指定资源图象</b>[VC/C++编程]”的内容,如果你对以上该文章内容感兴趣,你可以看看七道奇为您推荐以下文章:
本文地址: | 与您的QQ/BBS好友分享! |