Discussions related to Visual Prolog
Harrison Pratt
VIP Member
Posts: 405
Joined: 5 Nov 2000 0:01

Limitations on loading a bitmap from a resource

Unread post 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?
User avatar
Boris Belov
Posts: 1
Joined: 25 Feb 2022 11:30

Re: Limitations on loading a bitmap from a resource

Unread post by Boris Belov »

Hi Harrison,
To investigate the problem, please send your bitmaps to support@visual-prolog.com
Regards Boris Belov
Post Reply