396
社区成员




Function ulong ImageList_SetBkColor(long himl, ulong clrBk) Library "comctl32.dll"
//设置ImageList背景色
Function ulong ImageList_GetBkColor(long himl) Library "comctl32.dll"
//返回ImageList背景色
Function boolean ImageList_Destroy(long himl) Library "comctl32.dll"
//卸载ImageList
Function boolean ImageList_SetOverlayImage(long himl, long iImage, long iOverlay) Library "comctl32.dll"
//
Function boolean ImageList_Draw(long himl, long i, long hdcDst, long x, long y, ulong fStyle) Library "comctl32.dll"
//选ImageList中的一个图片绘制在指定DC上
Function boolean ImageList_DrawIndirect(IMAGELISTDRAWPARAMS p) Library "comctl32.dll"
//按IMAGELISTDRAWPARAMS结构指示绘图
Function boolean ImageList_Replace( long himl, long i, long hbmImage, long hbmMask) Library "comctl32.dll"
//替换ImageList中被选中的位图
Function boolean ImageList_DrawEx( long himl, long i, long hdcDst, long x, long y, long dx, long dy, ulong rgbBk, ulong rgbFg, ulong fStyle) Library "comctl32.dll"
//ImageList_Draw相似
Function boolean ImageList_Remove( long himl, long i) Library "comctl32.dll"
//移去一个图片
Function boolean ImageList_BeginDrag( long himlTrack, long iTrack, long dxHotspot, long dyHotspot) Library "comctl32.dll"
开始托动
Function boolean ImageList_EndDrag() Library "comctl32.dll"
结束托动
Function boolean ImageList_DragEnter( long hwndLock, long x, long y) Library "comctl32.dll"
将托动图象锁定到指定窗口,并显视在指定位置
Function boolean ImageList_DragLeave( long hwndLock) Library "comctl32.dll"
刚好跟ImageList_DragEnter相反
Function boolean ImageList_DragMove( long x, long y) Library "comctl32.dll"
移动托动图象
Function boolean ImageList_SetDragCursorImage( long himlDrag, long iDrag, long dxHotspot, long dyHotspot) Library "comctl32.dll"
指定新的托动图片
Function boolean ImageList_DragShowNolock( boolean fShow) Library "comctl32.dll"
//显视或隐藏被托动的图像
Function boolean ImageList_GetIconSize(long himl, Ref long cx, Ref Long cy) Library "comctl32.dll"
//得到ImageList尺寸
Function boolean ImageList_SetIconSize(long himl, long cx, long cy) Library "comctl32.dll"
//设置ImageList尺寸
Function boolean ImageList_GetImageInfo(long himl, long i, Ref IMAGEINFO pImageInfo) Library "comctl32.dll"
//得到ImageList中的指定图片的基本信息
Function long ImageList_Duplicate( long himl) Library "comctl32.dll"
//复制ImageList得到一个新的ImageList
// Stream Functions
Function long ImageList_Read( long pstm) Library "comctl32.dll"
//从数据流中读取一个ImageList
Function boolean ImageList_Write( long himl, long pstm) Library "comctl32.dll"
//将ImageList写到一个数据流中
//draw state for disable look non-XP
FUNCTION long DrawState(Long hdc, Long hBrush, Long lpDrawStateProc , Long lParam, Long wParam, Long X, Long Y, Long cX, Long cY, Long fuFlags) Library "user32.dll" Alias for "DrawStateA;Ansi"
//显示图像并应用可视化效果来表示一个状态。(事实上我也没有搞清这个函数。)
关于imagelist的更多内容,可以查MSDN
http://msdn.microsoft.com/en-us/library/ms927688.aspx
也可以查一下cimagelist的使用
http://msdn.microsoft.com/zh-cn/library/cc468275(v=VS.71).aspx
http://msdn.microsoft.com/zh-cn/library/3wbc1wt4.aspx
这个是属于window下的comctl32库的内容,这里我也简单讲一下吧
Function long ImageList_Create(long cx, long cy, ulong flags, long cInitial, long cGrow) Library "comctl32.dll"
/*
创建ImageList(说到这个ImageList补充一下:这个ImageList实际上是一个Image<图片>集在逻辑上的一个容器,是装图片的。它的存在是让应用程序可以方便的使用和集中管理图片。)
(cx,cy) 是ImageList的距形的左上角的坐标,采用的是pixels为单位
flags这个标志是ImageList的类型标志,它的值如下:
#define ILC_MASK 0x00000001
//遮罩类型,如果用过flash的遮罩效果,这个就很好理解了。意思是:用一个单色的位图来求和另一个位图有点的公共布分。
//flash是怎么做的呢:两个图层,一个是遮罩,另一个是被遮罩。当被遮罩被遮罩层遮罩住了的时候,被遮罩被遮罩住的那部分图像就显视出来.
#define ILC_COLOR 0x00000000//使用默认的方式。
#define ILC_COLORDDB 0x000000FE//使用与设备相关的位图
#define ILC_COLOR4 0x00000004//使用4位(16色:4位二进制可以表式0~F,16个值)
#define ILC_COLOR8 0x00000008//使用8位(256色:8位二进制可以表式00~FF,256个值)
#define ILC_COLOR16 0x00000010//使用16位(65536色:16位二进制可以表式0000~FFFF,65536个值)
#define ILC_COLOR24 0x00000018//使用24位(16777216色:24位二进制可以表式000000~FFFFFF,16777216个值)
#define ILC_COLOR32 0x00000020//使用32位(4294967296色:24位二进制可以表式00000000~FFFFFFFF,4294967296个值)
#define ILC_MIRROR 0x00002000 // 镜像图
cInitial//最初图片个数
cGrow//新增图片个数
返回值为ImageList的句柄
*/
Function long ImageList_GetImageCount(long himl) Library "comctl32.dll"
//返回ImageList的图片数
Function long ImageList_Add(long himl, long hbmImage, long hbmMask) Library "comctl32.dll"
/*
向ImageList添加一个位图
himl为ImageList的句柄
hbmImage待加的位图句柄
hbmMask遮罩位图句柄,如果不是用的遮罩方式,这个参数被忽略。
成功时返回添加后的素引,失败时返回-1
*/
Function long ImageList_ReplaceIcon(long himl, long i, long hicon) Library "comctl32.dll"
//替换图标
Function long ImageList_AddMasked( long himl, long hbmImage, ulong crMask) Library "comctl32.dll"
//添加一个掩码图
//这个跟遮罩相同还是相反,我也记不清了。
//如果的相同,就是取公共
//如果相反就是去公共
Function long ImageList_GetIcon( long himl, long i, ulong flags) Library "comctl32.dll"
//用ImageList中的位图创建一个图标,返回图标句柄
Function long ImageList_LoadImage( long hInstance, String lpbmp, long cx, long cGrow, ulong crMask, ulong uType, ulong uFlags) Library "comctl32.dll" ALIAS FOR "ImageList_LoadImageA;Ansi"
//创建一个ImageList,图片来源为application或DLL
Function long ImageList_Merge(long himl1, long i1, long himl2, long i2, long dx, long dy) Library "comctl32.dll"
//在两个ImageList中选各选一个图片,合并.
forward
global type n_imagelist from n_base
end type
end forward
global type n_imagelist from n_base
end type
global n_imagelist n_imagelist
type variables
Public:
String Name
Long Handle
String ImageName[]
String FullPath[]
Long ImageCount
Integer ImageWidth, ImageHeight
end variables
forward prototypes
public function integer of_getimageindex (readonly string as_imagename)
end prototypes
public function integer of_getimageindex (readonly string as_imagename);string ls
long n
ls = UPPER(as_imagename)
FOR n = 1 to ImageCount
IF ls = ImageName[n] THEN RETURN n
NEXT
RETURN CRet.FAILURE
end function
C++伪码表示:
class n_imagelist:public n_base
{
public:
string Name;//给imagelist一个命名。(这个对象主要是给n_svc_resource使用,而各图象的路径是存在一个数据窗口对象里面的,所以这里实际上就是一个数据窗口对象名)
long Handle;//imagelist的句柄
String ImageName[];//图象名字表(这个图象,可以在输入数据窗口的对应字段里找到.可以查看:imgcommon16,imgcommon24,imgfamfam等)
String FullPath[];//图象路径表(用的是全路径)
Long ImageCount;//图象数目
Integer ImageWidth;//图象宽
Integer ImageHeight;//图象高
integer of_getimageindex (readonly string as_imagename);//查找图象名
}
integer n_imagelist::of_getimageindex (readonly string as_imagename)//这个函数没有什么好说的,相信大家都可以看懂
{
string ls;
long n;
ls = UPPER(as_imagename);
FOR(n = 1;n <= ImageCount;n ++)
IF(ls = ImageName[n])
RETURN n;
RETURN CRet.FAILURE;
}