MCPcopy Create free account
hub / github.com/lxn/walk / AddImage

Method AddImage

imagelist.go:134–152  ·  view source on GitHub ↗
(image interface{})

Source from the content-addressed store, hash-verified

132}
133
134func (il *ImageList) AddImage(image interface{}) (int32, error) {
135 switch image.(type) {
136 case ExtractableIcon, *Icon:
137 icon, err := IconFrom(image, il.dpi)
138 if err != nil {
139 return 0, err
140 }
141
142 return il.AddIcon(icon)
143
144 default:
145 bmp, err := BitmapFrom(image, il.dpi)
146 if err != nil {
147 return 0, err
148 }
149
150 return il.AddMasked(bmp)
151 }
152}
153
154func (il *ImageList) DrawPixels(canvas *Canvas, index int, bounds Rectangle) error {
155 if !win.ImageList_DrawEx(il.hIml, int32(index), canvas.hdc, int32(bounds.X), int32(bounds.Y), int32(bounds.Width), int32(bounds.Height), win.CLR_DEFAULT, win.CLR_DEFAULT, win.ILD_NORMAL) {

Callers 1

imageIndexMethod · 0.80

Calls 4

AddIconMethod · 0.95
AddMaskedMethod · 0.95
IconFromFunction · 0.85
BitmapFromFunction · 0.85

Tested by

no test coverage detected