This forum is temporaily read-only. All existing discussions remain available for reference. For new questions, bug reports or support requests, please contact us at mail@lmdsupport.com.
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).
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