Re: FlexGrid and icons



Simon Woods <simonjwoods@xxxxxxxxxxx>'s wild thoughts were
released on Fri, 21 Dec 2007 16:15:20 +0000 bearing the
following fruit:

Jan Hyde (VB MVP) wrote:
Simon Woods <simonjwoods@xxxxxxxxxxx>'s wild thoughts were
released on Fri, 21 Dec 2007 14:13:41 +0000 bearing the
following fruit:

Hi

I'm populating a flexgrid and I want to put an icon into one of the
cells. I'm

1) loading a 16x16 icon from the Resource file into a memory variable
2) setting icon to a the cellpicture property

I have tried it with a 14x16 bitmap, it is absolutely fine. The problem
with the bitmap is the background is not transparent.

When I view this, the icon is too big (I mean massively too big, not
just 2 icons too big). When I view the icon in the resource file viewer,
it is also the right size.

So what do I need to do to get the icon to display as 16x16?

Are you sure it doesn't have multiple icon sizes in the one
.ico file?

Yep.

Try adding an imagelist and setting it to 16x16, add your
icon to it and retrieve it from there for display in the
grid. See if it displays the correct size or not.

OK. Thx Jan. I found an old thread that suggested this seems to be known
behaviour of the FlexGrid ... and that bitmaps were the way to go. Have
you managed to load a 16x16 icon into a flexgrid's .CellPicture? If so,
have you any sample code I could look at?

Its a long time since I used the MSFlexgrid but I recall I
used bitmaps myself but that was because I needed pictures
with odd dimensions.


--
Jan Hyde

https://mvp.support.microsoft.com/profile/Jan.Hyde
.



Relevant Pages

  • Re: Toolbar bitmap grief!
    ... compatible with my toolbar. ... Then send me the URL to this refresh icon or tell me how you converted it? ... You say change the background color, well by default for a toolbar bitmap ...
    (microsoft.public.vc.mfc)
  • Re: Some issues on Tk
    ... I use the "wm iconbitmap" command to change the icon of the main ... wm iconbitmap window ?bitmap? ... If bitmap is specified, then it names a bitmap in the standard ...
    (comp.lang.tcl)
  • Re: colored text and bitmap in CListBox
    ... Either way, if he uses LBS_HASSTRINGS in his listbox or stores them himself, ... for example, it would have a command to draw a string, then a bitmap, then ... then another bitmap, etc. ... would therefore display no icon, a circle-i, ...
    (microsoft.public.vc.mfc)
  • Re: colored text and bitmap in CListBox
    ... for example, it would have a command to draw a string, then a bitmap, then ... then another bitmap, etc. ... would therefore display no icon, a circle-i, ... class Icon: public MessageObject { ...
    (microsoft.public.vc.mfc)
  • Re: converting from an icon to a bitmnap
    ... // Create an empty bitmap ... // Load icon from stream ... // get IPictureDisp pointer ... So I try to render my icon to a bitmap by something like that. ...
    (microsoft.public.win32.programmer.gdi)