예제 #1
0
파일: imagelist.go 프로젝트: wangch/walk
func NewImageList(imageSize Size, maskColor Color) (*ImageList, error) {
	hIml := win.ImageList_Create(
		int32(imageSize.Width),
		int32(imageSize.Height),
		win.ILC_MASK|win.ILC_COLOR24,
		8,
		8)
	if hIml == 0 {
		return nil, newError("ImageList_Create failed")
	}

	return &ImageList{hIml: hIml, maskColor: maskColor}, nil
}
예제 #2
0
파일: imagelist.go 프로젝트: wangch/walk
func imageListForImage(image interface{}) (hIml win.HIMAGELIST, isSysIml bool, err error) {
	if filePath, ok := image.(string); ok {
		_, hIml = iconIndexAndHImlForFilePath(filePath)
		isSysIml = hIml != 0
	} else {
		w, h := win.GetSystemMetrics(win.SM_CXSMICON), win.GetSystemMetrics(win.SM_CYSMICON)

		hIml = win.ImageList_Create(w, h, win.ILC_MASK|win.ILC_COLOR24, 8, 8)
		if hIml == 0 {
			return 0, false, newError("ImageList_Create failed")
		}
	}

	return
}