MCPcopy Create free account
hub / github.com/9chu/LuaSTGPlus / LoadImageFromMemory

Method LoadImageFromMemory

LuaSTGPlus/SplashWindow.cpp:11–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9using namespace LuaSTGPlus;
10
11Gdiplus::Image* SplashWindow::LoadImageFromMemory(fcData data, size_t len)
12{
13 HGLOBAL hMem = GlobalAlloc(GMEM_FIXED, len);
14 fData pData = (fData)GlobalLock(hMem);
15 memcpy(pData, data, len);
16 IStream* pstm;
17 CreateStreamOnHGlobal(hMem, FALSE, &pstm);
18 Image* ret = Gdiplus::Image::FromStream(pstm);
19 GlobalUnlock(hMem);
20 pstm->Release();
21 return ret;
22}
23
24Gdiplus::Image* SplashWindow::LoadImageFromResource(UINT nID, LPCTSTR sTR)
25{

Callers

nothing calls this directly

Calls 1

ReleaseMethod · 0.45

Tested by

no test coverage detected