Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
HIcon to ImageList
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00324431
Message ID:
00325707
Vues:
27
>>George,
>>
>> Read your August, 1998 Foxpro Advisor on icon related Windows API calls. Great article. Helped a lot. I mastered
>> your demo's in the article too.
>>
>> One thing it doesn't mention which I can't find anywhere is this: How do I get an icon handle (eg. from Extracticon) to
>> load into the MSComCtrl Imagelist (used by Treeview and Listview).
>>
>> Somehow, I need to go from hIcon (integer) to the same thing that would be returned by LoadPicture(file.ico) (object).
>> Even VB help on this is pretty sparse.
>>
>> I'd appreciate any advice you could give.
>>
>> Thanks
>
>Hi Craig,
>
>I think this question has come up before. Unfortunately, AFAIK, there's no way to do this. If you know what the icons are going to be beforehand, I'd recommend combining them into a single bitmap as using the Picture Clip control as a source for the images. It'll reduce the number of files that have to be loaded and thus speed up the process.


Dear George,

LoadPicture() picture function gives back an object reference, with the type of picture.

It is a iPicture OLE interface. It has the following properties:

Handle, hPal, Type, Width, Height, CurDC, KeepOriginalFormat, Attributes

It has the following methods:
Render(), SelectPicture() PictureChanged(), SaveAsFile()

So, to have the handle of loaded picture:

oObj=LoadPicture(...)
?oObj.Handle

That's all!

bb
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform