SimpleWindow
载入中...
搜索中...
未找到
ImageList.h
1#pragma once
2
3#include <windows.h>
4
5// commctrl.h需要在windows.h之后包含
6#include <commctrl.h>
7
8namespace sw
9{
15 {
16 private:
20 HIMAGELIST _hImageList;
21
25 bool _isWrap;
26
27 protected:
34
35 public:
44 ImageList(int cx, int cy, UINT flags, int cInitial, int cGrow) noexcept;
45
51 ImageList(const ImageList &other) noexcept;
52
58
64
72
79
89 static ImageList Create(int cx, int cy, UINT flags, int cInitial, int cGrow) noexcept;
90
97
108
117 static bool DragEnter(HWND hwndLock, int x, int y) noexcept;
118
125
133 static bool DragMove(int x, int y) noexcept;
134
141
146
154
167
180
192
199
200 public:
206
212
219
227
234
242
251
261 bool Draw(int i, HDC hdcDst, int x, int y, UINT fStyle) noexcept;
262
276 bool Draw(int i, HDC hdcDst, int x, int y, int dx, int dy, COLORREF rgbBk, COLORREF rgbFg, UINT fStyle) noexcept;
277
283
289
297
304 bool GetIconSize(int &cx, int &cy) noexcept;
305
311
319
325 bool Remove(int i) noexcept;
326
332
341
349
356
365
372 bool SetIconSize(int cx, int cy) noexcept;
373
380
388
395
396 private:
400 void _DestroyIfNotWrap() noexcept;
401 };
402}
值转换器接口
Definition IValueConverter.h:14
Win32图像列表句柄的RAII包装
Definition ImageList.h:15
int ReplaceIcon(int i, HICON hicon) noexcept
更换图标,该函数调用ImageList_ReplaceIcon
static bool Copy(const ImageList &dst, int iDst, const ImageList &src, int iSrc, UINT uFlags) noexcept
复制图像,该函数调用ImageList_Copy
bool BeginDrag(int iTrack, int dxHotspot, int dyHotspot) noexcept
开始拖拽图像,该函数调用ImageList_BeginDrag
bool SetOverlayImage(int iImage, int iOverlay) noexcept
将指定的图像添加到要用作覆盖遮罩的图像列表中,该函数调用ImageList_SetOverlayImage
bool GetImageInfo(int i, IMAGEINFO *pImageInfo) noexcept
获取图像信息,该函数调用ImageList_GetImageInfo
int GetImageCount() noexcept
获取图像个数,该函数调用ImageList_GetImageCount
static ImageList Create(int cx, int cy, UINT flags, int cInitial, int cGrow) noexcept
创建图像列表,该函数调用ImageList_Create
bool IsWrap() const noexcept
判断当前对象是否为包装对象
static void EndDrag() noexcept
结束拖拽操作并销毁临时拖拽图像列表,该函数调用ImageList_EndDrag
int AddIcon(HICON hIcon) noexcept
添加图标,该函数调用ImageList_AddIcon
static bool DragMove(int x, int y) noexcept
拖拽移动,一般在WM_MOUSEMOVE函数中调用,该函数调用ImageList_DragMove
bool GetIconSize(int &cx, int &cy) noexcept
获取图标大小,该函数调用ImageList_GetIconSize
static bool DragShowNolock(bool fShow) noexcept
拖拽时显示或隐藏图像,该函数调用ImageList_DragShowNolock
bool Draw(int i, HDC hdcDst, int x, int y, UINT fStyle) noexcept
在指定上下文DC下绘制图像,该函数调用ImageList_Draw
~ImageList() noexcept
析构图像列表对象
bool SetImageCount(UINT uNewCount) noexcept
设置图像个数,该函数调用ImageList_SetImageCount
static bool DragLeave(HWND hwndLock) noexcept
解除窗口锁定并隐藏显示的拖拽图像,该函数调用ImageList_DragLeave
static ImageList Merge(const ImageList &iml1, int i1, const ImageList &iml2, int i2, int dx, int dy) noexcept
合并两个图像列表,该函数调用ImageList_Merge
HICON GetIcon(int i, UINT flags) noexcept
通过指定位置的图像创建图标句柄,该函数调用ImageList_GetIcon
static bool DragEnter(HWND hwndLock, int x, int y) noexcept
锁定窗口并在指定窗口内显示拖拽图像,该函数调用ImageList_DragEnter
bool SetIconSize(int cx, int cy) noexcept
设置图像大小并移除所有图像,该函数调用ImageList_SetIconSize
ImageList(const ImageList &other) noexcept
拷贝构造图像列表对象
bool SetDragCursorImage(int iDrag, int dxHotspot, int dyHotspot) noexcept
设置拖拽图标为指定图标与当前拖拽图标的结合,该函数调用ImageList_SetDragCursorImage
COLORREF SetBkColor(COLORREF clrBk) noexcept
设置背景颜色,该函数调用ImageList_SetBkColor
int AddMasked(HBITMAP hbmImage, COLORREF crMask) noexcept
添加图像,指定颜色为mask,该函数调用ImageList_AddMasked
HIMAGELIST ReleaseHandle() noexcept
获取图像列表句柄并取消对句柄的托管
static ImageList Wrap(HIMAGELIST hImageList) noexcept
将已有图像列表句柄包装为ImageList对象
COLORREF GetBkColor() noexcept
获取背景颜色,该函数调用ImageList_GetBkColor
bool RemoveAll() noexcept
移除所有图像,该函数调用ImageList_Remove
static ImageList LoadImageA(HINSTANCE hi, LPCSTR lpbmp, int cx, int cGrow, COLORREF crMask, UINT uType, UINT uFlags) noexcept
加载图像列表,该函数调用ImageList_LoadImageA
ImageList(ImageList &&other) noexcept
移动构造图像列表对象
ImageList Duplicate() noexcept
复制当前图像列表,该函数调用ImageList_Duplicate
bool Write(IStream *pstm) noexcept
写图像列表,该函数调用ImageList_Write
HIMAGELIST GetHandle() const noexcept
获取图像列表句柄
ImageList(HIMAGELIST hImageList, bool isWrap) noexcept
使用已有句柄初始化图像列表对象
static ImageList Read(IStream *pstm) noexcept
读取图像列表,该函数调用ImageList_Read
static ImageList GetDragImage(POINT *ppt, POINT *pptHotspot) noexcept
获取拖拽中的临时图像列表,该函数调用ImageList_GetDragImage
static ImageList LoadImageW(HINSTANCE hi, LPCWSTR lpbmp, int cx, int cGrow, COLORREF crMask, UINT uType, UINT uFlags) noexcept
加载图像列表,该函数调用ImageList_LoadImageW
ImageList(int cx, int cy, UINT flags, int cInitial, int cGrow) noexcept
创建图像列表,该函数调用ImageList_Create
SimpleWindow框架的顶级命名空间,所有公共类型、控件、枚举和工具函数均定义于此。
Definition Alignment.h:4