Article View: borland.public.cppbuilder.nativeapi
Article #5709Re: Problems with LoadImage and ResInstLoad
From: Mike Collins
Date: Wed, 20 Jul 2005 10:03
Date: Wed, 20 Jul 2005 10:03
45 lines
3069 bytes
3069 bytes
Ok, I'll expand further, all as I will explain, I've devised a work around -
but it still seems there is a bug with the ResInstLoad() and ResourceLoad()
methods of TImageList.
Firstly, I've confirmed that the Image / Bitmap is correctly 'embedded' into
the resource of my DLL buy examining the resource section with ExeScope (a
resource hacker.) and it looks fine.
Secondly, the TImageList is being used to provide images for a menu bar
(Toolbar2000 to be presise, although I've tested the problem with the
default builder toolbar) - which I know supports 256-colour images because,
at design-time, I can add images into my ImageList and then assign them to
the various buttons, where the images are displayed correctly.
Thirdly, as you suggested, I tryed extracting one of the images from the
TImageList and assigning it to a TImage stuck on my MainForm, thus
ImageList->GetBitmap(2, Image1->Picture->Bitmap);
- again, the Image is not displayed correctly, which suggests to me, that
the images are not being loaded into the TImageList correctly, indicating a
problem with ResInstLoad() and ResourceLoad() (both of which I've tried).
However, if I dynamically create a Graphics::TBitmap object, load the
image(s) out of my resource DLL using LoadFromResourceName() and then assign
the newly loaded bitmap over to the TImageList (using Add()), it all works
fine - which again, suggests to me that there is a problem with the two
resource loading functions of TImageList, and thus any decendants thereof.
Doing well here, two mistical problems in as many weeks,
Cheers
"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message
news:42ddb6ff$1@newsgroups.borland.com...
>
> How exactly are you using the TImageList? Maybe the display, not the
> ImageList, only supports 16 colors. Did you try extracting one of the
> bitmaps from the ImageList to see what it looks like?
>
>
> You cannot assign the Handle of a TImageList to be the image loaded by
> LoadImage(). The Handle expects an HIMAGELIST, not an HBITMAP
Technical Details
Message-ID:
<42de1f56$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news-out.newsfeeds.com!propagator3-LAX.newsfeeds.com!news-in.spamkiller.net!news-in.superfeed.net!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<42dda33d@newsgroups.borland.com> <42ddb6ff$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,3637b9fcce8b4510 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Mike Collins" <its@thebottomofthe.post> Newsgroups: borland.public.cppbuilder.nativeapi References: <42dda33d@newsgroups.borland.com> <42ddb6ff$1@newsgroups.borland.com> Subject: Re: Problems with LoadImage and ResInstLoad Date: Wed, 20 Jul 2005 11:03:45 +0100 Lines: 47 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.3790.1830 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.1830 X-RFC2646: Format=Flowed; Original NNTP-Posting-Host: 81.2.92.14 Message-ID: <42de1f56$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1121853270 81.2.92.14 (20 Jul 2005 02:54:30 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news-out.newsfeeds.com!propagator3-LAX.newsfeeds.com!news-in.spamkiller.net!news-in.superfeed.net!caladan.landsraad.net!newsgroups.borland.com!not-for-mail