Limitations on loading a bitmap from a resource
Posted: 18 Feb 2022 16:48
It appears that one cannot retrieve bitmap images from a resource if the image has more than 24 bpp color depth.
I get the runtime exception listed below if idb_bitmap64_transparent is a 32 bpp image, so I have to load it from a file instead of from a resource.
Is this a Windows limitation or an IDE limitation?
Code: Select all
onPaint(_Source, _Rectangle, GDI) :-
% ... usual GDI+ parameters removed
ImgOpaq = bitmap::createFromResID(HModule, resourceIdentifiers::idb_bitmap64_opaque, 20, 20),
Graphics:drawImageI(ImgOpaq, 10, 80),
ImgTran = bitmap::createFromResID(HModule, resourceIdentifiers::idb_bitmap64_transparent, 20, 20),
Graphics:drawImageI(ImgTran, 80, 80),
Code: Select all
Internal run-time exception occurred
Arguments = Cannot load image from resource ID: 10001
internal (exception)
bitmap::loadImageHandle
pfc\gui\gdiplus\image\bitmap\bitmap.pro(176,9)