Hi...
I have built a listbox a while ago on WinXPPro that works fine with a custom imageManager that gets his icons from a bmp strip. Now, I installed Dolphin on my laptop and with exactly the sam image file the icons of the listbox-items disappear on selected entries. Other dolphin stuff works fine, though. I have no idea where to look. Any tips or ideas would be highly appreciated :-) Ciao ...Jochen |
Jochen,
> I have built a listbox a while ago on WinXPPro that works fine with a > custom imageManager that gets his icons from a bmp strip. Now, I > installed Dolphin on my laptop and with exactly the sam image file > the icons of the listbox-items disappear on selected entries. Could you just clarify which icons disappear. Is it always the same icons or is a case of specific items in the list box not displaying any icon at all. I can't think of anything obvious but - are the colour resolutions of the main box and laptop the same?. Perhaps the laptop just can't display the icons. - if you display the main bitmap file in Dolphin do you see all the icons. - if you iterate through all the icons in the image manager, can they all be displayed. - perhaps the laptop is using a different index for the icons.Are the icons that you can see the ones you expected to see. How have you set up your custom ImageManager - via a WinImageList? Ian |
Hi Ian...
> Could you just clarify which icons disappear. Is it always the same icons > or is a case of specific items in the list box not displaying any icon at > all. Yep, you are right, I should clarify: The same icon is used for selected and unselected entries (no tricks here) The listbox shows some entries with text and icons - just fine I click on an entry and the icon is gone (the offset remains, so there is a white spot) I deselect the entry and the icon appears again. In contrast, on the PC all is well. PC is 24bit color (Matrox millenium), laptop is 32bit color (Geforce4) Anyway other listboxes with icon entries work. > - perhaps the laptop is using a different index for the icons.Are the icons > that you can see the ones you expected to see. How have you set up your > custom ImageManager - via a WinImageList? Don't have the code at hand, but essentially I load them with the trick you told me into a winImageList, then create a new ImageManager and add all the icons to it. The imageManager is then set into the listbox. For the index, I override iconIndex. The imageManager is my own, the icons are loaded from my selfmade bmp file. Can it be that in the course of rendering a selected icon inside dolphin some image processing is made to the icon that fails on the laptop? Ciao ...Jochen I |
Jochen,
My first guess is that there might be a problem with the mask used by the icon, although it does seem strange that it works on one system and not the other. This might be explained by the way that an unmasked image is displayed and the GDI rule that is used to merge the colours (one from the icon and one from the highlight bar) to create a new colour for the display. I suppose that one easy thing you could try is temporarily dropping the laptop down to 24 bit colours (if you can) and seeing if that changes the behaviour. The laptop's colour scheme might make a difference as well? On the related subject, Blair posted a article on 18 September that mentioned icon masks. To quote... =~=~=~=~=~= It is generally easier to use Icons than Bitmaps, and the results will probably be more satisfactory, but it is not essential. The issue is how to create the "mask" for the transparent background areas of the image. ImageManagers have a way to do this for bitmaps which involves choosing a colour to be treated as transparent. The addition of images to the image manage is double-dispatched, so it does not matter whether you add bitmaps or icons. An example of the use of bitmaps with a list view can be seen in the Active-X Control Browser's "New Control" dialog, which displays the toolbox bitmaps registered for each control alongside its description. The code that sets this up can be seen in AXControlSite class>>chooseControl: =~=~=~=~=~= I think that just boils down to consistently using a specific colour for transparent areas when creating the bitmaps and the, before adding any images to your image manager, evaluating... imageManager maskcolor: Color face3d. ... where the colour argument is the colour you originally used. However, I have found that this can all get a bit confusing as the Bitmap can also perform a colour mapping (see Bitmap>>setMap3DColors). Also, as you mentioned in a earlier post, the colour of the top left pixel can also have an effect in a WinImageList. You might like to also consider creating a "proper" icon, with mask, and seeing if that exhibits the same problem. <plug> My ImageManager goodie will allow you to create icons with a transparent background which, when saved as an icon file, is used to create a full mask. </plug> Ian |
Free forum by Nabble | Edit this page |