interesting question about displaying icons 
Author Message
 interesting question about displaying icons

heres a question that the more technically minded might enjoy! Within my
application, I am trying to display an icon that I have retrieved from an
exe file (from information I have retreived from the 'defaulticon' key in
the registry). I am using the ExtractIcon api, which returns me the handle
of the icon:

        hIcon = ExtractIcon(App.hInstance, Mid(deficon, 1, findin - 1),
nIcon)

and then I am using the following code to display the icon in a picture box:

        Set Picture2.Picture = LoadPicture("") ' Clear the picture box
        Picture2.AutoRedraw = True
        Call DrawIcon(Picture2.hdc, 0, 0, hIcon)
        Picture2.AutoRedraw = False
        Picture2.Refresh

Which is all very well - but what I want to do now is add the icon to an
imagelist so that it can be used in a treeview as the icon against the
node - which is a different (much smaller) image from within the icon file.
Im using a line like:
        MDIForm1.ImageList1.ListImages.Add ,, , Picture2.Image
which adds the image in, but when I display it in the treeview its all
scrunched up and horribly distorted.
I think somehow i need to be able to identify the specific icon image (the
16x16 I guess) which I know exists in the icon within the application.

If anyones read this far, thanks for your perserverence - and for any help
thats forthcoming!

Regards
Adrian.



Mon, 03 Dec 2001 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Interesting modular program design question w/in

2. Interesting Design Question

3. An Interesting 15 Question Survey

4. Interesting Question

5. interesting dbgrid question

6. Interesting Query Question

7. A tough question - but interesting...

8. Here's an interesting question for you!

9. interesting question?

10. An interesting graphical question:

11. SQL Speed Question (Really Interesting me thinks)

12. Interesting VB3 vs VB6 Question

 

 
Powered by phpBB® Forum Software