Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

Icons in disabled Toolbuttons not drawn in gray

We have modified LMDGlyphs, TLMDButtonGlyph.DrawButtonGlyph

In section

  if FUsePng then

we change

  FPngGlyph.Draw(Canvas, Rect(GlyphPos.X, GlyphPos.Y, GlyphPos.X + IcW, GlyphPos.Y + IcH));

to


          if State = ebsDisabled then
          begin
            LPNGGray := TLMDPNGGrayscaleFilter.Create;
            try
              LPNGGray.SourceImage := FPngGlyph;
              LPNGGray.ResultImage.Draw(Canvas, Rect(GlyphPos.X, GlyphPos.Y, GlyphPos.X + IcW, GlyphPos.Y + IcH));
            finally
              LPNGGray.Free;
            end;
          end
          else
            FPngGlyph.Draw(Canvas, Rect(GlyphPos.X, GlyphPos.Y, GlyphPos.X + IcW, GlyphPos.Y + IcH));

for non streched drawing.

This work for us to draw the images correct in gray-scaled.
Please check this an make it also available for streched drawing (we don't use streched drawing).

Comments

Sign In or Register to comment.