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

Function newBitmapFromResource

bitmap.go:191–205  ·  view source on GitHub ↗
(res *uint16, dpi int)

Source from the content-addressed store, hash-verified

189}
190
191func 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.
208func NewBitmapFromImageWithSize(image Image, size Size) (*Bitmap, error) {

Callers 4

NewBitmapFromResourceFunction · 0.85
NewBitmapFromResourceIdFunction · 0.85

Calls 2

lastErrorFunction · 0.85
newBitmapFromHBITMAPFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…