ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Load HICON into ImageEn

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
Andy_Bell Posted - Aug 27 2020 : 18:17:03
Hi

I'm using the Windows function ExtractIcon(...) to return a HICON handle to an executable file's first Icon resource.

Currently, I'm having to load it into a TImage using its Picture->Icon->Handle property and then save it to a temp file before loading into ImageEn.

It seems convoluted but I looked at TIEResourceExtractor and that seemed far more complex than I needed. I was also unable to figure out a way to reliably get the same icon that ExtractIcon was returning.

Questions:

Can I load the Icon returned by ExtractIcon into ImageEn - that is just from the Icon Handle?

Is there a simple way to use TIEResourceExtractor to do this?

Andy

Andy
3   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Aug 30 2020 : 22:57:57
Hi Andy

Well the other option is to get a TIcon object from the hicon value (lots of code on the web for this).

You can then call:

ImageEnView1.Assign( myIcon );

Nigel
Xequte Software
www.imageen.com
Andy_Bell Posted - Aug 28 2020 : 03:37:01
Thanks

I get link errors with that function:

Error: Unresolved external '__fastcall Bmpfilt::IEConvertIconToBitmap(void *,Iexbitmaps::TIEBitmap *,Bmpfilt::TInvalidJumboIconAction)' referenced from 'ExternalEditors.obj'

Even if I include bmpfilt.pas in my project, I still get the error. C++ Builder 2007

The function is not in Image En Library file - I'm statically linking... If I include bmpfilt.pas in my project, bmpfilt.obj contains no accessible methods... Weird. My Delphi is not good enough to fix this, I'm afraid.

Is there a define I need to make to get the function included?

ADD: I can create a delphi project in RAD Studio 2007 and call the function ok. But not in Builder.

Andy
xequte Posted - Aug 27 2020 : 19:33:49
Hi Andy

The method is not documented, but you can just use IEConvertIconToBitmap in the bmpfilt unit.

procedure IEConvertIconToBitmap(icon: HICON; DestBitmap: TIEBitmap; InvalidJumboIconAction : TInvalidJumboIconAction = ijiaIgnore);

e.g.
IEConvertIconToBitmap( hicon, ImageEnView1.IEBitmap );
ImageEnView1.Update();


Nigel
Xequte Software
www.imageen.com