[Please do not mail me a copy of your followup]
"R.Wieser" <
[email protected]d> spake the secret code <vgb5e6$130d7$
[email protected]> thusly:
Richard,
I see that on ComCtl32.dll version 6 or later, they have a way
for you to QueryInterface for an IImageList interface which has
a Replace method that you can use to replace the bitmap.
The "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.
Without decompiling, we don't know what the implementation does, 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. Otherwise you impose the requirement on the caller that
the supplied bitmap must outlive the image list, which is not only a
poor design but isn't documented in the Replace or Add functions for
image lists. In fact, the Add function documentation explicitly
mentions that the supplied bitmap is copied into an "internal data
structure".
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.
Again, without decompiling, we can't infer what happens behind the
scenes. 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.
Again, have you tried that and does it give the desired visual
results?
If yes, what exactly is the problem?
But 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; you are intended to use the
ImageList functions to replace images as a whole. The bitmap handle
in the IMAGEINFO struct could be use as the source for a bitmap copy,
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. I'm away
from my copy of Rector & Newcomer, so I don't have anything besides
the MS docs to go on.
It's entirely possible that this "manipulate the bitmap directly"
language is a holdover from Win16 and isn't relevant to Win32.
--
"The Direct3D Graphics Pipeline" free book <
http://tinyurl.com/d3d-pipeline>
The Terminals Wiki <
http://terminals-wiki.org>
The Computer Graphics Museum <
http://computergraphicsmuseum.org>
Legalize Adulthood! (my blog) <
http://legalizeadulthood.wordpress.com>
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)