Richard,
Post by legalize+ (Richard)Post by R.WieserThe "IImageList::Replace" method you mean (or the function
"ImageList_Replace") ?
I didn't notice the function until you mentioned it, but they seem
to be the same.
Have you tried the function? It seems to do what you want.
[quote=me]
Yes, you can replace the image *of a single item* with that. Which is
rather useless when you have a big bitmap (from "ImageList_GetImageInfo"),
with all items on it.
[/quote]
Post by legalize+ (Richard)Without decompiling, we don't know what the implementation does,
Yes, we do. That is what the "learn.microsoft.com" website is for.
Post by legalize+ (Richard)but if I were to implement it, I would take the given bitmap and use
that as a source for a copy operation into the internal bitmap used
by the image list.
There are exacly *two* functions which accept images for multiple items, and
those do not seem to accept a grid of them (such as ImageList_GetImageInfo
returns), looking at the explanation "The number of images is inferred from
the width of the bitmap" to the "hbmImage" argument.
Post by legalize+ (Richard)In fact, the Add function documentation explicitly mentions that
the supplied bitmap is copied into an "internal data structure".
Besides the above problem, how does that "add" function REPLACE the
origional bitmap ?
Post by legalize+ (Richard)Again, without decompiling, we can't infer what happens behind the
scenes.
Again, yes we can. Its called "reading the documentation". Unless you want
to claim that the MS documentation is untrustworthy and should be ignored.
:-)
Post by legalize+ (Richard)At best, we should only be going by what is documented behavior,
and it seems that ImageList_Replace is the function provided
to do what you want.
The "iIndex" parameter and its "An index of the image to replace"
explanation to that function tells me otherwise.
Post by legalize+ (Richard)Again, have you tried that and does it give the desired visual
results?
If yes, what exactly is the problem?
You want me to test something that is at odds with the explanation to those*
functions ? Why ? Just to see if you can catch MS on having made a mistake
?
* you're flip-flopping, without saying, between the "add" and the "replace"
function.
But, have it your way. Testing both ... No, neither works as you expected.
Post by legalize+ (Richard)Post by R.WieserBut you've skipped the most important part of the problem: How do I
edit that big bitmap ?
I don't think you can edit it directly;
Even though MS says otherwise ? On what grounds ?
Post by legalize+ (Richard)you are intended to use the ImageList functions to replace images as a
whole.
Nope. There is not a single function which does that.
Post by legalize+ (Richard)The bitmap handle in the IMAGEINFO struct could be use as the source
for a bitmap copy,
Ofcourse you can. You just don't get the result you think you should be
getting. :-p
Post by legalize+ (Richard)but as you (and the documentation points out) the bitmap is selected
into a DC and there's no way to obtain that internal DC.
:-) Guess again. Its even easy to get those DC's. But, as mentioned
earlier, poking into undocumented structures is a bit of a no-no.
Post by legalize+ (Richard)I'm away from my copy of Rector & Newcomer, so I don't have anything
besides the MS docs to go on.
As mentioned and shown, the latter is what I'm using too. And as such I'm
wondering about how you got to your "can be used to replace the full image"
conclusion.
Post by legalize+ (Richard)It's entirely possible that this "manipulate the bitmap directly"
language is a holdover from Win16 and isn't relevant to Win32.
You mean that that "information" has survived for almost a quarter of
century and multiple "remove everything about old Windows versions" cleanups
? Well, I guess that is possible. Everything is.
Regards,
Rudy Wieser