(image interface{})
| 132 | } |
| 133 | |
| 134 | func (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 | |
| 154 | func (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) { |
no test coverage detected