本文整理汇总了C++中ImageList_Add函数的典型用法代码示例。如果您正苦于以下问题:C++ ImageList_Add函数的具体用法?C++ ImageList_Add怎么用?C++ ImageList_Add使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ImageList_Add函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: ImageList_Create
void MainWindow::W7ToolbarSetImages() {
QPixmap img;
QBitmap mask;
HIMAGELIST himl = ImageList_Create(20, 20, ILC_COLOR32, 4, 0);
img = QIcon(":/back.png").pixmap(20);
mask = img.createMaskFromColor(Qt::transparent);
ImageList_Add(himl, img.toWinHBITMAP(QPixmap::PremultipliedAlpha), mask.toWinHBITMAP());
img = QIcon(":/play.png").pixmap(20);
mask = img.createMaskFromColor(Qt::transparent);
ImageList_Add(himl, img.toWinHBITMAP(QPixmap::PremultipliedAlpha), mask.toWinHBITMAP());
img = QIcon(":/forward.png").pixmap(20);
mask = img.createMaskFromColor(Qt::transparent);
ImageList_Add(himl, img.toWinHBITMAP(QPixmap::PremultipliedAlpha), mask.toWinHBITMAP());
img = QIcon(":/pause.png").pixmap(20);
mask = img.createMaskFromColor(Qt::transparent);
ImageList_Add(himl, img.toWinHBITMAP(QPixmap::PremultipliedAlpha), mask.toWinHBITMAP());
if (m_w7toolbar) m_w7toolbar->ThumbBarSetImageList(this->winId(), himl);
ImageList_Destroy(himl);
}
开发者ID:Vanyar53,项目名称:blogstuff,代码行数:25,代码来源:mainwindow.cpp
示例2: ImageList_Add
void InsertObjectDialog::LoadObjects()
{
// Create imagelists
m_LargeImages.Create(32, 32, ILC_COLOR24, 0, 10);
small_images.Create(16, 16, ILC_COLOR24, 0, 10);
map<int, CPlugin>::iterator i = g_Plugins.begin();
for ( ; i != g_Plugins.end(); i++)
{
CString lowerName = i->second.m_Name;
lowerName.MakeLower();
if (!i->second.m_bMovement && lowerName != "tag")
{
bool bGame = false;
if (application.runtime != CApplication::rt_application) bGame = true;
if (!bGame && i->second.m_Category == OT_GAME)
continue;
// Extract the icon
ImageList_Add(m_LargeImages, i->second.m_LargeIcon, NULL);
ImageList_Add(small_images, i->second.m_SmallIcon, NULL);
}
}
}
开发者ID:aolko,项目名称:construct,代码行数:27,代码来源:Insert+Object+Dlg.cpp
示例3: wbCreateTreeViewImageList
BOOL wbCreateTreeViewImageList(PWBOBJ pwbo, HBITMAP hbmImage, int nImages, COLORREF clTransparent)
{
HBITMAP hbmMask;
static HIMAGELIST hi;
BITMAP bm;
if(!pwbo || !pwbo->hwnd || !IsWindow(pwbo->hwnd))
return FALSE;
if(hbmImage && nImages) {
GetObject(hbmImage, sizeof(BITMAP), (LPSTR) &bm);
if((bm.bmWidth == 0) | (bm.bmHeight == 0))
return FALSE;
nImages = MAX(1, MIN(nImages, MIN(bm.bmWidth, MAX_IMAGELIST_IMAGES)));
if(clTransparent != NOCOLOR) {
hbmMask = wbCreateMask(hbmImage, clTransparent);
hi = ImageList_Create(bm.bmWidth / nImages, bm.bmHeight, ILC_COLORDDB | ILC_MASK, nImages, 0);
ImageList_Add(hi, hbmImage, hbmMask);
TreeView_SetImageList(pwbo->hwnd, hi, TVSIL_NORMAL);
DeleteObject(hbmMask);
} else {
hi = ImageList_Create(bm.bmWidth / nImages, bm.bmHeight, ILC_COLORDDB, nImages, 0);
ImageList_Add(hi, hbmImage, NULL);
TreeView_SetImageList(pwbo->hwnd, hi, TVSIL_NORMAL);
}
} else {
TreeView_SetImageList(pwbo->hwnd, NULL, TVSIL_NORMAL);
ImageList_Destroy(hi);
}
return TRUE;
}
开发者ID:Darksynx,项目名称:WinBinder,代码行数:34,代码来源:wb_control_treeview.c
示例4: ImageList_Destroy
// Create a drag image from a bitmap and optional cursor
bool wxDragImage::Create(const wxBitmap& image, const wxCursor& cursor)
{
if ( m_hImageList )
ImageList_Destroy(GetHimageList());
m_hImageList = 0;
#ifdef __WXWINCE__
UINT flags = ILC_COLOR;
#else
UINT flags wxDUMMY_INITIALIZE(0) ;
if (image.GetDepth() <= 4)
flags = ILC_COLOR4;
else if (image.GetDepth() <= 8)
flags = ILC_COLOR8;
else if (image.GetDepth() <= 16)
flags = ILC_COLOR16;
else if (image.GetDepth() <= 24)
flags = ILC_COLOR24;
else
flags = ILC_COLOR32;
#endif
bool mask = (image.GetMask() != 0);
// Curiously, even if the image doesn't have a mask,
// we still have to use ILC_MASK or the image won't show
// up when dragged.
// if ( mask )
flags |= ILC_MASK;
m_hImageList = (WXHIMAGELIST) ImageList_Create(image.GetWidth(), image.GetHeight(), flags, 1, 1);
int index;
if (!mask)
{
HBITMAP hBitmap1 = (HBITMAP) image.GetHBITMAP();
index = ImageList_Add(GetHimageList(), hBitmap1, 0);
}
else
{
HBITMAP hBitmap1 = (HBITMAP) image.GetHBITMAP();
HBITMAP hBitmap2 = (HBITMAP) image.GetMask()->GetMaskBitmap();
HBITMAP hbmpMask = wxInvertMask(hBitmap2);
index = ImageList_Add(GetHimageList(), hBitmap1, hbmpMask);
::DeleteObject(hbmpMask);
}
if ( index == -1 )
{
wxLogError(_("Couldn't add an image to the image list."));
}
m_cursor = cursor; // Can only combine with drag image after calling BeginDrag.
return (index != -1) ;
}
开发者ID:NullNoname,项目名称:dolphin,代码行数:56,代码来源:dragimag.cpp
示例5: _ui_init
BOOL _ui_init(
HINSTANCE h_inst
)
{
HBITMAP undisk = LoadBitmap( h_inst, MAKEINTRESOURCE( IDB_UNDISK ) );
HBITMAP undisk_mask = LoadBitmap( h_inst, MAKEINTRESOURCE( IDB_UNDISK_MASK ) );
HBITMAP disk = LoadBitmap( h_inst, MAKEINTRESOURCE( IDB_DISK ) );
HBITMAP disk_mask = LoadBitmap( h_inst, MAKEINTRESOURCE( IDB_DISK_MASK ) );
HBITMAP cdrom = LoadBitmap( h_inst, MAKEINTRESOURCE( IDB_CDROM ) );
HBITMAP cdrom_mask = LoadBitmap( h_inst, MAKEINTRESOURCE( IDB_CDROM_MASK ) );
HBITMAP disk_enb = LoadBitmap( h_inst, MAKEINTRESOURCE( IDB_ENABLED ) );
HBITMAP check = LoadBitmap( h_inst, MAKEINTRESOURCE( IDB_CHECK ) );
HBITMAP check_mask = LoadBitmap( h_inst, MAKEINTRESOURCE( IDB_CHECK_MASK ) );
NONCLIENTMETRICS metric = { sizeof(metric) };
InitCommonControls( );
if ( LoadLibrary(L"riched20.dll") == 0 ) return FALSE;
__hinst = h_inst;
__dlg = HWND_DESKTOP;
metric.lfMessageFont.lfWeight = FW_BOLD;
metric.lfMessageFont.lfHeight = -11;
__font_bold = CreateFontIndirect( &metric.lfMessageFont );
metric.lfMessageFont.lfWeight = FW_DONTCARE;
metric.lfMessageFont.lfUnderline = TRUE;
__font_link = CreateFontIndirect( &metric.lfMessageFont );
metric.lfMessageFont.lfHeight = -9;
metric.lfMessageFont.lfUnderline = FALSE;
__font_small = CreateFontIndirect( &metric.lfMessageFont );
__img = ImageList_Create( 9, 9, ILC_MASK, 2, 2 );
__dsk_img = ImageList_Create( 15, 11, ILC_MASK | ILC_COLOR24, 5, 5 );
ImageList_Add( __img, check, check_mask );
ImageList_Add( __dsk_img, disk, disk_mask );
ImageList_Add( __dsk_img, undisk, undisk_mask );
ImageList_Add( __dsk_img, disk_enb, disk_mask );
ImageList_Add( __dsk_img, cdrom, cdrom_mask );
__cur_arrow = LoadCursor( NULL, IDC_ARROW );
__cur_hand = LoadCursor( NULL, IDC_HAND );
__cur_wait = LoadCursor( NULL, IDC_WAIT );
return TRUE;
}
开发者ID:capturePointer,项目名称:diskcryptor,代码行数:55,代码来源:ui_utils.c
示例6: ImageList_Destroy
void pListView::setImageList() {
auto &list = listView.state.image;
if(imageList) {
ImageList_Destroy(imageList);
imageList = nullptr;
}
bool found = false;
for(auto &row : listView.state.image) {
for(auto &column : row) {
if(column.empty() == false) {
found = true;
break;
}
}
}
if(found == false) return;
imageList = ImageList_Create(15, 15, ILC_COLOR32, 1, 0);
nall::image image;
image.allocate(15, 15);
image.clear(GetSysColor(COLOR_WINDOW));
ImageList_Add(imageList, CreateBitmap(image), NULL);
for(unsigned row = 0; row < list.size(); row++) {
for(unsigned column = 0; column < list(row).size(); column++) {
nall::image image = list(row)(column);
if(image.empty()) continue;
image.transform(0, 32, 255u << 24, 255u << 16, 255u << 8, 255u << 0);
image.scale(15, 15, Interpolation::Linear);
ImageList_Add(imageList, CreateBitmap(image), NULL);
}
}
ListView_SetImageList(hwnd, imageList, LVSIL_SMALL);
unsigned ID = 1;
for(unsigned row = 0; row < list.size(); row++) {
for(unsigned column = 0; column < list(row).size(); column++) {
if(list(row)(column).empty()) continue; //I_IMAGENONE does not work properly
LVITEM item;
item.mask = LVIF_IMAGE;
item.iItem = row;
item.iSubItem = column;
item.iImage = ID++;
ListView_SetItem(hwnd, &item);
}
}
}
开发者ID:vgmtool,项目名称:vgmtool,代码行数:50,代码来源:list-view.cpp
示例7: images
MapData::MapData(char const* path)
: images(DictionaryMap::alNumNoCase)
{
imgList = NULL;
map = MPQArchive::open(path, File::READ);
if (map == NULL)
map = MPQArchive::open(String::buildFullName(cfg.warPath, path), File::READ);
if (map)
{
imgList = ImageList_Create(16, 16, ILC_COLOR24, 16, 16);
MPQLoader loader(*getApp()->getWarLoader());
loader.addArchive(map);
LoadGameData(data, &loader, WC3_LOAD_UNITS | WC3_LOAD_ITEMS |
WC3_LOAD_ABILITIES | WC3_LOAD_UPGRADES | WC3_LOAD_MERGED | WC3_LOAD_NO_WEONLY);
Image blank(16, 16);
blank.fill(Image::clr(255, 255, 255));
HBITMAP hBitmap = blank.createBitmap();
ImageList_Add(imgList, hBitmap, NULL);
DeleteObject(hBitmap);
images.set("", 0);
}
}
开发者ID:liyonghelpme,项目名称:dota-replay-manager,代码行数:25,代码来源:mapdata.cpp
示例8: ImageList_Add
void AnimatorBar::UpdateFilmStrip()
{
film_strip.SetRedraw(false);
m_ImageList.DeleteImageList();
film_strip.DeleteAllItems();
if(!m_pCurrentAnimation)
return;
m_ImageList.Create(32, 32, ILC_COLOR24, 3, 3);
film_strip.SetImageList(&m_ImageList, LVSIL_NORMAL);
for (int i = 0; i < m_pCurrentAnimation->m_Images.size(); i++)
{
// Create thumbnail & add to filmstrip
CImageResource* pImage = application->resources.FindImageResourceFromNumber(m_pCurrentAnimation->m_Images[i]);
if(pImage)
{
HBITMAP Bitmap = pImage->GetHBitmap(true,false);
ImageList_Add(m_ImageList.m_hImageList, Bitmap, Bitmap);
CString Name;
Name.Format("%d", i + 1);
film_strip.InsertItem(i, Name, i);
}
}
film_strip.SetRedraw(true);
film_strip.Invalidate();
}
开发者ID:aolko,项目名称:construct,代码行数:32,代码来源:Animator+Bar.cpp
示例9: GetISpinner
void RendSplineParamsMapDlgProc::Initialize(HWND hWnd, TimeValue t)
{
if (hWnd == NULL) return;
else
{
ISpinnerControl *iSpin = GetISpinner(GetDlgItem(hWnd, IDC_ASPECTSPIN));
iSpin->LinkToEdit(GetDlgItem(hWnd, IDC_ASPECT), EDITTYPE_FLOAT);
iSpin->SetLimits(0.0f,99999999.0f);
iSpin->SetAutoScale(TRUE);
ReleaseISpinner(iSpin);
if (RendSpline::hLockButton == NULL) {
HBITMAP hBitmap, hMask;
RendSpline::hLockButton = ImageList_Create(16, 15, TRUE, 2, 0);
hBitmap = LoadBitmap(RendSplineDesc.HInstance(), MAKEINTRESOURCE(IDB_LOCK));
hMask = LoadBitmap(RendSplineDesc.HInstance(), MAKEINTRESOURCE(IDB_LOCKMASK));
ImageList_Add(RendSpline::hLockButton,hBitmap,hMask);
DeleteObject(hBitmap);
DeleteObject(hMask);
}
ICustButton *lockAspect = GetICustButton(GetDlgItem(hWnd,IDC_ASPECTLOCK));
lockAspect->SetImage(RendSpline::hLockButton,0,0,1,1,16,15);
lockAspect->SetType(CBT_CHECK);
ReleaseICustButton(lockAspect);
CheckRadioButton(hWnd, IDC_VIEWPORT, IDC_RENDERER, IDC_RENDERER);
BOOL usePhysUVs = mod->GetUsePhysicalScaleUVs();
CheckDlgButton(hWnd, IDC_REAL_WORLD_MAP_SIZE, usePhysUVs);
}
}
开发者ID:innovatelogic,项目名称:ilogic-vm,代码行数:33,代码来源:rendspline.cpp
示例10: InitIML
void InitIML() {
int i;
HIMAGELIST hImageList = ImageList_Create(16, 16, ILC_COLOR32, 3, 0);
HBITMAP hbIcons = (HBITMAP)LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDB_BITMAP1), IMAGE_BITMAP, 48, 16, LR_DEFAULTCOLOR);
ImageList_Add(hImageList, hbIcons, NULL);
for (i = 0; i != 3; i++)
stateicons[i] = ImageList_GetIcon(hImageList, i, ILD_NORMAL);
SendMessage(hWnd_Tab, TCM_SETIMAGELIST, LVSIL_SMALL, (LPARAM)hImageList);
hCfgTabiml = ImageList_Create(16, 16, ILC_COLOR32, 6, 0);
hbIcons = (HBITMAP)LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDB_BITMAP3), IMAGE_BITMAP, 96, 16, LR_DEFAULTCOLOR);
ImageList_AddMasked(hCfgTabiml, hbIcons, 0);
/////listview images
hImageList = ImageList_Create(28, 14, ILC_COLOR32 | ILC_MASK, 32, 0);
ImageList_SetBkColor(hImageList, CLR_NONE);
lvwIML = hImageList;
hbIcons = (HBITMAP)LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDB_BITMAP2), IMAGE_BITMAP, 896, 14, /*ILC_MASK |*/ LR_DEFAULTCOLOR);
//ImageList_Remove(hImageList, -1);
//char asdf[32];
//sprintf(asdf, "%d", CLR_INVALID == -1);
//MessageBox(0,asdf,0,0);
ImageList_AddMasked(hImageList, hbIcons, 0);
for (i = 0; i != NUM_BNICONS; i++)
bnicons[i] = ImageList_GetIcon(hImageList, i, ILD_NORMAL);
}
开发者ID:kwolekr,项目名称:horizon,代码行数:28,代码来源:gui.cpp
示例11: CreateBitmap
void pButton::setImage(const image& image, Orientation orientation) {
nall::image nallImage = image;
nallImage.transform(0, 32, 255u << 24, 255u << 16, 255u << 8, 255u << 0);
if(hbitmap) { DeleteObject(hbitmap); hbitmap = 0; }
if(himagelist) { ImageList_Destroy(himagelist); himagelist = 0; }
if(OsVersion() >= WindowsVista) {
hbitmap = CreateBitmap(nallImage);
SendMessage(hwnd, BM_SETIMAGE, IMAGE_BITMAP, (LPARAM)hbitmap);
switch(orientation) {
case Orientation::Horizontal: SetWindowLongPtr(hwnd, GWL_STYLE, GetWindowLongPtr(hwnd, GWL_STYLE) & ~BS_TOP); break;
case Orientation::Vertical: SetWindowLongPtr(hwnd, GWL_STYLE, GetWindowLongPtr(hwnd, GWL_STYLE) | BS_TOP); break;
}
} else {
//Windows XP and earlier cannot display bitmaps and text at the same time with BM_SETIMAGE
//Use BCM_SETIMAGELIST instead. It does not support alpha blending, so blend with button color
//The XP theme and above use a gradient fade background, so it won't be a perfect match there
nallImage.alphaBlend(GetSysColor(COLOR_BTNFACE));
hbitmap = CreateBitmap(nallImage);
himagelist = ImageList_Create(nallImage.width, nallImage.height, ILC_COLOR32, 1, 0);
ImageList_Add(himagelist, hbitmap, NULL);
BUTTON_IMAGELIST list;
list.himl = himagelist;
switch(orientation) {
case Orientation::Horizontal: SetRect(&list.margin, 5, 0, 0, 0); list.uAlign = BUTTON_IMAGELIST_ALIGN_LEFT; break;
case Orientation::Vertical: SetRect(&list.margin, 0, 5, 0, 0); list.uAlign = BUTTON_IMAGELIST_ALIGN_TOP; break;
}
Button_SetImageList(hwnd, &list);
}
setText(button.state.text); //update text to display nicely with image (or lack thereof)
}
开发者ID:ChoccyHobNob,项目名称:DiCE,代码行数:33,代码来源:button.cpp
示例12: ImageList_GetIconSize
int Icon::add_to_imagelist(HIMAGELIST himl, HDC hdc_wnd, COLORREF bk_color, HBRUSH bk_brush) const
{
int ret;
if (_itype == IT_SYSCACHE) {
HIMAGELIST himl = g_Globals._icon_cache.get_sys_imagelist();
int cx, cy;
ImageList_GetIconSize(himl, &cx, &cy);
HBITMAP hbmp = CreateCompatibleBitmap(hdc_wnd, cx, cy);
HDC hdc = CreateCompatibleDC(hdc_wnd);
HBITMAP hbmp_old = SelectBitmap(hdc, hbmp);
ImageList_DrawEx(himl, _sys_idx, hdc, 0, 0, cx, cy, bk_color, CLR_DEFAULT, ILD_NORMAL);
SelectBitmap(hdc, hbmp_old);
DeleteDC(hdc);
ret = ImageList_Add(himl, hbmp, 0);
DeleteObject(hbmp);
} else
ret = ImageList_AddAlphaIcon(himl, _hicon, bk_brush, hdc_wnd);
return ret;
}
开发者ID:darkvaderXD2014,项目名称:reactos,代码行数:25,代码来源:explorer.cpp
示例13: CreateToolbar
HWND Explorerplusplus::CreateTabToolbar(HWND hParent,int idCommand,TCHAR *szTip)
{
HWND TabToolbar = CreateToolbar(hParent,WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS|
TBSTYLE_TOOLTIPS|TBSTYLE_LIST|TBSTYLE_TRANSPARENT|TBSTYLE_FLAT|CCS_NODIVIDER|
CCS_NOPARENTALIGN|CCS_NORESIZE,TBSTYLE_EX_MIXEDBUTTONS|TBSTYLE_EX_DOUBLEBUFFER);
SendMessage(TabToolbar,TB_SETBITMAPSIZE,0,MAKELONG(7,7));
SendMessage(TabToolbar,TB_BUTTONSTRUCTSIZE,sizeof(TBBUTTON),0);
SendMessage(TabToolbar,TB_SETBUTTONSIZE,0,MAKELPARAM(16,16));
/* TODO: The image list is been leaked. */
HIMAGELIST himl = ImageList_Create(7,7,ILC_COLOR32|ILC_MASK,0,2);
HBITMAP hb = LoadBitmap(GetModuleHandle(0),MAKEINTRESOURCE(IDB_TABTOOLBAR_CLOSE));
int iIndex = ImageList_Add(himl,hb,NULL);
SendMessage(TabToolbar,TB_SETIMAGELIST,0,reinterpret_cast<LPARAM>(himl));
DeleteObject(hb);
/* Add the close button, used to close tabs. */
TBBUTTON tbButton;
tbButton.iBitmap = iIndex;
tbButton.idCommand = idCommand;
tbButton.fsState = TBSTATE_ENABLED;
tbButton.fsStyle = TBSTYLE_BUTTON|TBSTYLE_AUTOSIZE;
tbButton.dwData = 0;
tbButton.iString = reinterpret_cast<INT_PTR>(szTip);
SendMessage(TabToolbar,TB_INSERTBUTTON,0,reinterpret_cast<LPARAM>(&tbButton));
SendMessage(TabToolbar,TB_AUTOSIZE,0,0);
return TabToolbar;
}
开发者ID:3scp8,项目名称:explorerplusplus,代码行数:31,代码来源:WindowHandler.cpp
示例14: LoadBitmap
// CRotateDlg message handlers
BOOL CRotateDlg::OnInitDialog()
{
CDialog::OnInitDialog();
m_AngleIcons.Create(16, 16, ILC_COLOR24 | ILC_MASK, 3, 3);
HBITMAP icon = LoadBitmap(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_ANGLEICONS));
ImageList_Add(m_AngleIcons, icon, NULL);
DeleteObject(icon);
m_Angle.SetImageList(&m_AngleIcons);
m_Angle.SetWindowText("0");
for (int i = 0; i < 8; i++)
{
COMBOBOXEXITEM insItem;
insItem.mask = CBEIF_IMAGE | CBEIF_TEXT | CBEIF_SELECTEDIMAGE;
insItem.iItem = i;
insItem.iImage = i;
insItem.iSelectedImage = i;
CString Text;
Text.Format("%d", i * 45);
insItem.pszText = Text.GetBuffer(0);
m_Angle.InsertItem(&insItem);
}
m_Angle.SetFocus();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
开发者ID:DavidPulido,项目名称:Contruct,代码行数:35,代码来源:Rotate+Dlg.cpp
示例15: LoadBitmapW
bool
CRootNode::SetupNode()
{
// Load the bitmap we'll be using as the root image
HBITMAP hRootImage;
hRootImage = LoadBitmapW(g_hThisInstance,
MAKEINTRESOURCEW(IDB_ROOT_IMAGE));
if (hRootImage == NULL) return FALSE;
// Add this bitmap to the device image list. This is a bit hacky, but it's safe
m_ClassImage = ImageList_Add(m_ImageListData->ImageList,
hRootImage,
NULL);
DeleteObject(hRootImage);
// Get the root instance
CONFIGRET cr;
cr = CM_Locate_DevNodeW(&m_DevInst,
NULL,
CM_LOCATE_DEVNODE_NORMAL);
if (cr != CR_SUCCESS)
{
return false;
}
// The root name is the computer name
DWORD Size = DISPLAY_NAME_LEN;
GetComputerNameW(m_DisplayName, &Size);
return true;
}
开发者ID:CSRedRat,项目名称:reactos,代码行数:33,代码来源:RootNode.cpp
示例16: ImageList_Add
HRESULT CCImageList::AddBitmapFromHandle(int* pn, HBITMAP hbm)
{
int n = ImageList_Add(m_hImageList, hbm, NULL);
DeleteObject(hbm);
if(pn) *pn = n;
return n == -1 ? E_FAIL : S_OK;
}
开发者ID:thenfour,项目名称:Volumizer,代码行数:7,代码来源:CCImageList.cpp
示例17: ImageList_Add
void CAnimationEditorDlg::UpdateList()
{
m_Frames.SetRedraw(false);
m_ImageList.DeleteImageList();
m_Frames.DeleteAllItems();
if(!m_CurrentAnimation)
return;
m_ImageList.Create(32, 32, ILC_COLOR24, 3, 3);
m_Frames.SetImageList(&m_ImageList, LVSIL_NORMAL);
for (int i = 0; i < m_CurrentAnimation->m_Images.size(); i++)
{
// Create thumbnail & add to filmstrip
CImageResource* image = m_pApplication->FindImageResourceFromNumber(m_CurrentAnimation->m_Images[i]);
if(image)
{
HBITMAP Bitmap = image->GetHBitmap(true,false);
ImageList_Add(m_ImageList.m_hImageList, Bitmap, Bitmap);
CString name;
name.Format("%d", i+1);
m_Frames.InsertItem(i, name, i);
}
}
m_Frames.SetRedraw(true);
m_Frames.Invalidate();
}
开发者ID:DavidPulido,项目名称:Contruct,代码行数:32,代码来源:AnimationEditorDlg.cpp
示例18: memset
BOOL MyTreeView::setItemIcon(HTREEITEM elem, HBITMAP icon)
{
if ( !icon ) return FALSE;
TVITEM item;
memset(&item, 0, sizeof(TVITEM));
BOOL ret = FALSE;
if ( getItem(elem, &item) )
{
//cambio immagine
int idimg = ImageList_Add(imgList, icon, NULL);
if ( idimg != -1 )
{
//elimino la vecchia immagine
//La ImageList_Remove rimuove un'immagine dalla lista ma riordina gli indici delle immagini rimaste
//in modo da essere sempre un intervallo senza buchi
/*if ( item.iImage )
{
//l'immagine di default ha indice 0, le altre possono essere rimosse
ImageList_Remove(imgList, item.iImage);
}
*/
item.mask = TVIF_SELECTEDIMAGE | TVIF_IMAGE;
item.iImage = idimg;
item.iSelectedImage = idimg;
ret = SendMessage(hWnd, TVM_SETITEM, 0, (LPARAM)&item);
}
}
return ret;
}
开发者ID:MisterXYZ83,项目名称:SpotifyDownloaderWithGui,代码行数:33,代码来源:mia_treeview.cpp
示例19: wxDIB
// Adds a bitmap, and optionally a mask bitmap.
// Note that wxImageList creates new bitmaps, so you may delete
// 'bitmap' and 'mask'.
int wxImageList::Add(const wxBitmap& bitmap, const wxBitmap& mask)
{
HBITMAP hbmp;
#if wxUSE_WXDIB && wxUSE_IMAGE
// wxBitmap normally stores alpha in pre-multiplied format but
// ImageList_Draw() does pre-multiplication internally so we need to undo
// the pre-multiplication here. Converting back and forth like this is, of
// course, very inefficient but it's better than wrong appearance so we do
// this for now until a better way can be found.
AutoHBITMAP hbmpRelease;
if ( bitmap.HasAlpha() )
{
hbmp = wxDIB(bitmap.ConvertToImage(),
wxDIB::PixelFormat_NotPreMultiplied).Detach();
hbmpRelease.Init(hbmp);
}
else
#endif // wxUSE_WXDIB && wxUSE_IMAGE
hbmp = GetHbitmapOf(bitmap);
// Use mask only if we don't have alpha, the bitmap isn't drawn correctly
// if we use both.
AutoHBITMAP hbmpMask;
if ( !bitmap.HasAlpha() )
hbmpMask.Init(GetMaskForImage(bitmap, mask));
int index = ImageList_Add(GetHImageList(), hbmp, hbmpMask);
if ( index == -1 )
{
wxLogError(_("Couldn't add an image to the image list."));
}
return index;
}
开发者ID:pradek,项目名称:wxWidgets,代码行数:38,代码来源:imaglist.cpp
示例20: GetSystemMetrics
HIMAGELIST CheckedListView::CreateCheckBoxImageList(HWND hWnd)
{
HDC hdc_wnd, hdc;
HBITMAP hbm_im, hbm_mask, hbm_orig;
RECT rc;
HIMAGELIST himl;
int x = GetSystemMetrics(SM_CXSMICON);
himl = ImageList_Create(x, GetSystemMetrics(SM_CYSMICON), ILC_COLOR16 | ILC_MASK, 2, 2);
hdc_wnd = GetDC(hWnd);
hdc = CreateCompatibleDC(hdc_wnd);
hbm_im = CreateCompatibleBitmap(hdc_wnd, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON));
hbm_mask = CreateBitmap(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 1, 1, NULL);
ReleaseDC(hWnd, hdc_wnd);
rc.left = rc.top = 0;
rc.right = GetSystemMetrics(SM_CXSMICON);
rc.bottom = GetSystemMetrics(SM_CYSMICON);
hbm_orig = (HBITMAP) SelectObject(hdc, hbm_mask);
SelectObject(hdc, hbm_im);
// Create normal image
_createButtonCheckImage(hdc, &rc, false, CheckedColorNone);
SelectObject(hdc, hbm_orig);
ImageList_Add(himl, hbm_im, hbm_mask);
SelectObject(hdc, hbm_im);
// Create color checked images
CheckedColor colors[] = {CheckedColorBlack, CheckedColorGrey, CheckedColorYellow, CheckedColorGreen, CheckedColorNone};
CheckedColor* color = colors;
while (*color != CheckedColorNone)
{
_createButtonCheckImage(hdc, &rc, true, *color);
SelectObject(hdc, hbm_orig);
ImageList_Add(himl, hbm_im, hbm_mask);
SelectObject(hdc, hbm_im);
color++;
}
DeleteObject(hbm_mask);
DeleteObject(hbm_im);
DeleteDC(hdc);
return himl;
}
开发者ID:mitsurugi,项目名称:CatalanitzadorPerAWindows,代码行数:46,代码来源:CheckedListView.cpp
注:本文中的ImageList_Add函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论