Re: How to get an associated file icon without the Alpha Channel i
From: Mark Collard (MarkCollard_at_discussions.microsoft.com)
Date: 10/13/04
- Previous message: Morten: "Howto make a Copy of File and retrieve the resulting file name?"
- Next in thread: Mike D Sutton: "Re: How to get an associated file icon without the Alpha Channel i"
- Reply: Mike D Sutton: "Re: How to get an associated file icon without the Alpha Channel i"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 13 Oct 2004 01:17:03 -0700
Hi Mike
I think I've come up with a simply solution on how to create an icon with
the shadow effect, but I need a little help please.
I had a Picture Box control on to a Form and then used the SHGetFileInfo API
to get a handle to the small icon with an Alpha Channel. I then used the
DrawIconEx API to draw the icon on to the Picture Boxes DC. The icon is drawn
with the shadow effect.
This is what I'm thinking as a solution:
- Use the SHGetFileInfo to get a handle to the small file icon
- Create a DC using the CreateCompatibleDC API
- Draw the icon on to the DC using the DrawIconEx API (so that the alpha
channel is drawn as the shadow effect)
- Use the GetIconInfo API to get the Icon info
- Replace the icon bitmap with the image that was drawn in the DC. There is
no need to change the mask
- Convert the icon into a StdPicture object
It the "Replace the icon bitmap with the image that was drawn in the DC" bit
I don't know how to do.
Can you please show me how to do that bit?
Thanks again
Regards
Mark
- Previous message: Morten: "Howto make a Copy of File and retrieve the resulting file name?"
- Next in thread: Mike D Sutton: "Re: How to get an associated file icon without the Alpha Channel i"
- Reply: Mike D Sutton: "Re: How to get an associated file icon without the Alpha Channel i"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|