Bug Report B18929
Visible to All Users
Duplicate

We have closed this ticket because another page addresses its subject:

Loading a glyph from an ImageList, image isn't displayed in dxBarButton

TcxButton - Glyph loaded from an ImageList looks corrupted

created 17 years ago

Hi !
I installed the VCL Installer v29. Since that update we have problem with loading an image into the button. Before that version, everything was fine.
The command I use is the following :
  Data.ImageListEnabled.GetBitmap(17, btAfdrukVoorcalc.Glyph);
The image appears as a white square in the button.
I included a screenshot as attachment.
Many thanks in advance,
Nico Callewaert

Comments (1)
Serge (DevExpress Support) 17 years ago

    Hi Nico,
    We were informed of similar issues, and as we discovered, they are caused by the ImageList's GetBitmap method - it corrupts the resulting image. For more information on this item, please take a look at report B18452 ("Loading a glyph from an ImageList, image isn't displayed in dxBarButton"). If you are using a TcxImageList, please use its GetImage or GetImageInfo methods instead. They should work OK.
    In the meantime, this sounds rather odd that the problem was raised only in the last update 29. So, we would like to examine a sample project, if you can provide one, to give you a precise answer.
    Thanks,
    Serge

    Answers

    created 17 years ago

    Hi Nico,
    Thank you for the sample project. Yes, I do see the problem and, as I discovered, it has the same nature as the issue described in report B18452 ("Loading a glyph from an ImageList, image isn't displayed in dxBarButton"). So, it requires the same solution:

    Delphi
    type TBitmapAccess = class(TBitmap); ... btAfdrukVoorbeeld1Project.Glyph.PixelFormat := pf24bit; btAfdrukVoorbeeld1Project.Glyph.Canvas.Brush.Color := clFuchsia; btAfdrukVoorbeeld1Project.Glyph.Canvas.FillRect(Rect(0, 0, 16, 16)); ImageListEnabled.GetBitmap(1, btAfdrukVoorbeeld1Project.Glyph); TBitmapAccess(btAfdrukVoorbeeld1Project.Glyph).Changed(nil);

    In the meantime, I want to repeat that our TcxImageList is free of this problem and allows you to use a simple code:

    Delphi
    cxImageList1.GetImage(1, btAfdrukVoorbeeld1Project.Glyph);

    I have attached the updated version of your sample.
    Thanks,
    Serge

      Comments (3)
      Serge (DevExpress Support) 17 years ago

        You are welcome, Nico :)
        Serge

        JS JS
        Jürgen Scheffler 9 years ago

          9 years later we have this problem ;)
          So there is no solution because the WinForms ImageList, still has a problem?

          DevExpress Support Team 9 years ago

            Hello Jürgen,

            This ticket is related to an older version of our VCL components, but not WinForms controls. I have checked the project provided by Serge with the latest version of our VCL controls (16.1.3) and confirm that the approach he suggested still works correctly after these 9 years. If you found a similar problem with our WinForms controls, I kindly ask that you create a new ticket, and provide there a small sample project and a description demonstrating the problematic behavior. Thanks in advance.

            Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

            Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.