从系统中取得指定资源图像

2008-02-23 05:35:53来源:互联网 阅读 ()

新老客户大回馈,云服务器低至5折

在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);
}
}
//---------------------------------------------------------------------------




标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇: BMP位图文档结构及平滑缩放

下一篇: BitBlt()双缓冲解决图象闪烁

热门词条
热门标签