Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding Images To Imaglist At Runtime
Message
From
08/10/2001 15:07:26
 
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00565530
Message ID:
00565625
Views:
20
>>>>Does anyone know how to add images to an Imaglist control at runtime using Foxpro. I'm trying to load images from and .ico file and have not had any success. Any help would be appreciated.
>>>>
>>>>Thanks,
>>>>Dan
>>>
>>>Dan,
>>>See Message#565430.
>>>
>>>HTH.
>>
>>Larry,
>>
>>Another question.
>>
>>I have two imagelists. One is 32x32 and the other is 16x16. I'm trying to load the appropriate icon from the .ico. I can do this using the control's property page, but when I do it at runtime, both load with the same image. Any advice?
>>
>>Thanks,
>>Dan
>
>Dan,
>From the Windows Control help file (cmctl198.chm):
>
>When the ImageList control is bound to another Windows Common Control, images of different sizes can be added to the control, however the size of the image displayed in the associated Windows Common Control will be constrained to the size of the first image added to the ImageList. For example, if you add an image that is 16 by 16 pixels to an ImageList control, then bind the ImageList to a TreeView control (to be displayed with Node objects), all images stored in the ImageList control will be displayed at 16 by 16 pixels, even if they are much larger or smaller.
>
>From this, all icons will be displayed as whatever you loaded first. They all will be large or small but not a combination of both.
>
>Sorry. :-(

Larry,

Let me explain this a little better, maybe. I'm using two imagelists (Icons and SmallIcons). My .ico has two icons in it. A 32x32 and a 16x16 (each is a different color). My form has two imagelists. I set Image1 to have a size of 32x32 and Image2 has a size of 16x16. I can use the property page to load the icon. Image1 will show the 32x32 icon and Image2 will show the 16x16 icon, the desired result. When I try to load them at runtime, both pick up the same icon. In my case, they both get the 32x32. Image2 is still 16x16. The 32x32 was resized to fit. I want to know how to get each imagelist to load the appropriatly sized icon from the file.

Thanks,
Dan
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform