Re: ImageList Questions

new topic     » goto parent     » topic index » view thread      » older message » newer message
ssallen said...

Hi Everyone,

I don't get the ImageList controls and the documentation is a bit sparse. Could someone explain how to get one's feet wet with them?

What library are you using? I'm going to assume Win32Lib. I wrote the original ImageList support, but it's been a while. An ImageList is the way that some controls organize the images that they display. Basically, you put the images into the ImageList, and then you can simply refer to the index of each image, rather than using handles, and possibly duplicating images in memory.

ssallen said...

Basic Questions:

Image Lists - It seems like I need to create one and add my images too it with the addDib/EuBmp/etc. functions but they only take one argument... how do I keep my imagelists seperate? If I have two different controls I want to pass bitmaps between how do I know what goes where? I guess I want to know where I get the imagelist handle from.

I think that Win32lib creates a few for you, so that you don't really need to manage them separately. It's a trade off between complexity and functionality, IIRC. Looking at the source code, I believe that win32lib automatically associates the correct ImageList with the control when it is created.

ssallen said...

What I want to be able to do is drag Image 1 to Window 2 and vice versa. I am going to be transferring thumbnails of images that are indexed back to the full size image and tracking the locations internally. I just can't figure out how this mechanism works.

I think that all you need to do is to track the image's index vs the source image. So when you need to set the image for some item in a control (I guess a ListView in this case), you use the ImageList index. But as long as you keep the handle or file name, or whatever you need to track for the image, you can translate back and forth.

The drag and drop stuff is a whole 'nother ball of wax.

Matt

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu