Have a png image behave like a font image

Viewing 20 posts - 1 through 20 (of 24 total)
  • Author
    Posts
  • #68680
    Support
    Keymaster

      Sorry, such feature is not implemented in the package.
      Where you planning to use these images? which component?

      #68681
      Stephane Senecal
      Participant

        Not the easiest way, but you could trace your PNGs into SVGs using, for example, Inkscape and then convert those into font glyphs with an online tool for example.

        Stephane Senecal
        CIS Group
        Delphi programmer since 2001

        #68683
        HeDiBo
        Participant

          Sorry, such feature is not implemented in the package.
          Where you planning to use these images? which component?

          The easiest would be if the TsImage would have a flag, saying “Act like a font” for black and white images. Not every icon is a character (see attachments), that’s why I ask this.

          PS. Apparently it is not possible to remove erroneous attachments in edit.

          • This reply was modified 5 years, 10 months ago by HeDiBo.
          • This reply was modified 5 years, 10 months ago by HeDiBo.
          Attachments:
          You must be logged in to view attached files.
          #68690
          Stephane Senecal
          Participant

            To AlphaSkins: Could it be possible to use a png as a mask and colorize it with any color?

            Stephane Senecal
            CIS Group
            Delphi programmer since 2001

            #68694
            HeDiBo
            Participant

              My idea was that most of that work was already done in TsCharImageList. So, it would not be much work to replicate for a black and white picture.

              #68793
              HeDiBo
              Participant

                Any comments, Serge?

                #68808
                Support
                Keymaster

                  Where you are planning to use these images? which component? TsImage? Or buttons? Or menus?

                  #68817
                  HeDiBo
                  Participant

                    Where you are planning to use these images? which component? TsImage? Or buttons? Or menus?

                    Anywhere where a TsCharImageList can be used as an image source. It probably would need a slightly modified version of the TsCharImageList where two-color images can be stored.

                    #68834
                    Support
                    Keymaster

                      The TsCharImageList component allow to define any custom colors for stored characters.
                      The problem is that your glyph is not character and may be stored in the TsAlphaImageList or in other imagelists.
                      But they can’t change a color of the custom image. Also, it’s not vector graphic and you should store big sized glyphs for further scaling.. Maybe will be better to make own font with these glyphs saved as characters?

                      #68844
                      HeDiBo
                      Participant

                        I didn’t realize the big difference between characters, being vectors, and my icons, being bitmaps.
                        Still it is an interesting idea to have bitmaps that become negative on dark skins.

                        #69012
                        HeDiBo
                        Participant

                          Any thoughts about this, Serge?

                          #69461
                          HeDiBo
                          Participant

                            Couldn’t you add a flag to a TsImage saying it should follow the skin. This would only work then on Black&White pictures.

                            #69495
                            Support
                            Keymaster

                              Plz, specify, this property must fill all non-transparent pixels in the image by color from skin?
                              How such property may be named?

                              #69498
                              HeDiBo
                              Participant

                                No. Just do what you do for characters. They are black on light skins, but white on darker skins.
                                For TsImage do similar: an image can be transparent or not. If the image is transparent, the B&W logic only applies to the visible part. If the image is not transparent, the whole image goes negative for dark skins.
                                If the image is a png image apply the B&W logic on the non-transparent part only. In that way, pixels that are partly visible because of anti-aliasing will also be made negative on darker skins.
                                The property can be named HonorSkinTone.

                                #69508
                                Support
                                Keymaster

                                  // If the image is not transparent, the whole image goes negative for dark skins.

                                  Just white rectangle will be shown in darks skins in this case =)

                                  #69521
                                  HeDiBo
                                  Participant

                                    That’s not a negative image.

                                    #69541
                                    Support
                                    Keymaster

                                      Hi
                                      Do you mean just inverted image if skin is dark?

                                      #69552
                                      HeDiBo
                                      Participant

                                        If skin is dark, make the white parts black, make the black parts white and leave the transoarent parts untouched.
                                        In Dutch that’s called a negative image, but the better term in English is inverted 😁

                                        #69561
                                        Stephane Senecal
                                        Participant

                                          I don’t think inverting the colors of an image is a good idea. It could have adverse effects on color images.

                                          HeDiBo, I thought you only wanted to use an image as a mask.

                                          Stephane Senecal
                                          CIS Group
                                          Delphi programmer since 2001

                                          #69562
                                          HeDiBo
                                          Participant

                                            I don’t think inverting the colors of an image is a good idea. It could have adverse effects on color images.

                                            I only want to use it for small 2 color black and white images.

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