A problem of TsAlphaImageList with VirtualTreeView

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #59418
    JM-DG
    Participant
      'Saeidd2016' wrote:

      Hello,

      There is a new problem in version 14.23 . When we set a TsAlphaImageList as image list of TVirtualTreeView component, it only shows grayed images and doesn't show colored images.

      It seems to be related to the recently changed BlendMode to the TsAlphaImageList component.

      I made a demo testing the new feature and there are a few unexpected results. This is one of them.

      I'll share the demo when I'll get home.

      #59426
      JM-DG
      Participant

        It may be unrelated but I realised that the grayed property of the bitbtn seems to behave inconsistently.

        Let say I use an imagelist with an unchanged blendcolor clNone with white glyphs:

        – The normal glyph color will be white: ok.

        – When I set its property grayed to true, it becomes slightly colorblended depending of the skin (not grayed).

        But then, when I use an imagelist with a custom blendcolor (let's say clred) with white glyphs:

        – The normal glyph color will be red: ok.

        – When I set its property grayed to true, it becomes properly grayed.

        dDbLnZV.png

        So my question is:

        “If I use an imagelist with an unchanged blendcolor clNone with white glyphs & I set its property grayed to true, it becomes slightly colorblended depending of the skin (not grayed).”

        Why is that?

        #59429
        Support
        Keymaster

          Which behavior do you expect?

          #59433
          JM-DG
          Participant
            'Support' wrote:

            Which behavior do you expect?

            Well I don't understand

            why the glyph becomes slightly colored (light red) when grayed = true & the imagelist colorblend = clNone

            d08f06618e57983530fad23d5045ba3b.gif

            But becomes actually grayed when grayed = true & the imagelist colorblend = clRed (example).

            6c36f6a74ee6e20a355223c521c1ba6e.gif

            Why is it not grayed in both instances?

            I'm not sure of what behavior to expect,

            but in one instance (grayed = true) = glyph is colored

            and in another instance (grayed = true) = glyph is actually grayed.

            #59435
            Stephane Senecal
            Participant

              I don't know if “Support” was confused between the look of the glyph when the button is Enabled = False and the Grayed property of the BitBtn, but I was. So I though I could add my input.

              I too find it weird that the discoloration of an icon that has no color changes of color.

              It is like if the icon was blended with the button color.

              Stephane Senecal
              CIS Group
              Delphi programmer since 2001

              #59436
              JM-DG
              Participant
                'Stephane wrote:

                I don't know if “Support” was confused between the look of the glyph when the button is Enabled = False and the Grayed property of the BitBtn, but I was. So I though I could add my input.

                I too find it weird that the discoloration of an icon that has no color changes of color.

                It is like if the icon was blended with the button color.

                Yeah, thanks for your input. Sometimes I have a hard time expressing myself correctly in english. 🙂

                #59437
                Support
                Keymaster

                  Hello!

                  If Grayed property is True, then glyph is discolored, but some skins are looks ugly with gray glyphs.

                  Glyphs in such skins can have a changed color tone to the value, defined in the skin.

                  Dark glyph is not gray, this glyph have changed color tone too, but it's dark, because glyph color (Red) is dark.

                  Look my demo and screenshot, I hope, you will understand what I mean.

                  So, changing of color tone (by the Grayed property) is not depended from TsAlphaImageList.BlendColor value. Just dark icon looks not very good if Grayed=True and skin is dark.

                  #59456
                  Lasse
                  Participant

                    This issue still exists in version 14.24. Random icons have color and selected icon is quite black…

                    #59460
                    Lasse
                    Participant

                      I commented out following lines from acAlphaImageList.pas to fix this for now…

                      1308: //if BlendColor clNone then

                      1309: // ChangeBitmapPixels(Result, ChangeColorTone, acColorToRGB(BlendColor), clFuchsia);

                      Hmm, in my ImageList BlendColor property is clNone… it should not go there.

                      #59476
                      Support
                      Keymaster

                        Hello, Lasse!

                        I think, your issue is not linked with this topic. Can you show a demo with black icon in the selected item?

                        #59485
                        Lasse
                        Participant

                          It is. This was the first message: “When we set a TsAlphaImageList as image list of TVirtualTreeView component, it only shows grayed images and doesn't show colored images.”.

                          This issue happens only with virtual tree. I try to find time to create a small demo.

                          #59491
                          Saeidd2016
                          Participant
                            'Lasse' wrote:

                            It is. This was the first message: “When we set a TsAlphaImageList as image list of TVirtualTreeView component, it only shows grayed images and doesn't show colored images.”.

                            This issue happens only with virtual tree. I try to find time to create a small demo.

                            Yes I had wrote the first message. The problem still exists in v14.24 .

                            See the attached demo. I have two images in the AlphaImageList. The first image is grayed and the second is colored. The first image is shown correctly both in VirtualTreeView and sSpeedButton but when you set the image index of them to 1 (colored image) the image is shown as a white square.

                            [attachment=9303:ImageList.png]

                            [attachment=9302:Minimal.rar]

                            #59502
                            Support
                            Keymaster

                              Thank you for the demo.

                              The reason of the problem is in the VirtualTrees.pas file. You can find there a line like this:

                              Code:
                              Images.BlendColor := Color;

                              BlendColor of the imagelist is changed to clWhite, glyph is white colored and not visible on the white background.

                              #59512
                              Lasse
                              Participant

                                Oh, that seems to be a bug in VirtualTree. Setting a property like that is not a good idea.

                              Viewing 14 posts - 1 through 14 (of 14 total)
                              • You must be logged in to reply to this topic.