(res *uint16, dpi int)
| 189 | } |
| 190 | |
| 191 | func newBitmapFromResource(res *uint16, dpi int) (bm *Bitmap, err error) { |
| 192 | hInst := win.GetModuleHandle(nil) |
| 193 | if hInst == 0 { |
| 194 | err = lastError("GetModuleHandle") |
| 195 | return |
| 196 | } |
| 197 | |
| 198 | if hBmp := win.LoadImage(hInst, res, win.IMAGE_BITMAP, 0, 0, win.LR_CREATEDIBSECTION); hBmp == 0 { |
| 199 | err = lastError("LoadImage") |
| 200 | } else { |
| 201 | bm, err = newBitmapFromHBITMAP(win.HBITMAP(hBmp), dpi) |
| 202 | } |
| 203 | |
| 204 | return |
| 205 | } |
| 206 | |
| 207 | // NewBitmapFromImageWithSize creates a bitmap with given size in native units and paints the image on it streched. |
| 208 | func NewBitmapFromImageWithSize(image Image, size Size) (*Bitmap, error) { |
no test coverage detected
searching dependent graphs…