It could be like this:
CODE:
#Requires AutoHotkey v2
wnd := Gui('Resize')
wnd.MarginX := wnd.MarginY := 0
wnd.AddPicture(, 'HBITMAP: ' . CreateBitmap(300, 300, 0xFFFFAA00))
wnd.Show()
CreateBitmap(w, h, colorARGB) {
#DllLoad Gdiplus
static PixelFormat32bppARGB := 0x26200A
NumPut('Int', 1, GdiplusStartupInput := Buffer(8 + A_PtrSize * 2, 0))
DllCall('Gdiplus\GdiplusStartup', 'Ptr*', &pToken := 0, 'Ptr', GdiplusStartupInput, 'Ptr', 0)
DllCall('Gdiplus\GdipCreateBitmapFromScan0', 'Int', w, 'Int', h, 'Int', 0, 'Int', PixelFormat32bppARGB, 'Ptr', 0, 'Ptr*', &pBitmap := 0)
DllCall('Gdiplus\GdipGetImageGraphicsContext', 'Ptr', pBitmap, 'Ptr*', &pGraphics := 0)
DllCall('Gdiplus\GdipGraphicsClear', 'Ptr', pGraphics, 'UInt', colorARGB)
DllCall('Gdiplus\GdipCreateHBITMAPFromBitmap', 'Ptr', pBitmap, 'Ptr*', &hBitmap := 0, 'Int', 0xFFFFFFFF)
DllCall('Gdiplus\GdipDeleteGraphics', 'Ptr', pGraphics)
DllCall('Gdiplus\GdipDisposeImage', 'Ptr', pBitmap)
DllCall('Gdiplus\GdiplusShutdown', 'Ptr', pToken)
return hBitmap
}
Statistics: Posted by teadrinker — 23 minutes ago