Page 1 of 1

Limitations on loading a bitmap from a resource

Posted: 18 Feb 2022 16:48
by Harrison Pratt
It appears that one cannot retrieve bitmap images from a resource if the image has more than 24 bpp color depth.

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),
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.

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)
Is this a Windows limitation or an IDE limitation?

Re: Limitations on loading a bitmap from a resource

Posted: 25 Feb 2022 15:01
by Boris Belov
Hi Harrison,
To investigate the problem, please send your bitmaps to support@visual-prolog.com