From a883f4386120a6434aba332fb099afb5fed09466 Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Mon, 5 Jul 2010 17:07:29 +0200 Subject: Extended TfpgImage with a new CreateDisabledImage() method. This uses the new GrayScale Filter to create a grayscale image. --- src/corelib/fpg_main.pas | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/corelib/fpg_main.pas b/src/corelib/fpg_main.pas index 9c15760f..8bcda3fc 100644 --- a/src/corelib/fpg_main.pas +++ b/src/corelib/fpg_main.pas @@ -143,6 +143,7 @@ type TfpgImage = class(TfpgImageImpl) public + function CreateDisabledImage: TfpgImage; function ImageFromSource: TfpgImage; function ImageFromRect(var ARect: TRect): TfpgImage; overload; function ImageFromRect(var ARect: TfpgRect): TfpgImage; overload; @@ -400,7 +401,8 @@ uses fpg_hint, fpg_extgraphics, fpg_utils, - fpg_cmdlineparams; + fpg_cmdlineparams, + fpg_imgutils; var fpgTimers: TList; @@ -2088,6 +2090,12 @@ end; { TfpgImage } +function TfpgImage.CreateDisabledImage: TfpgImage; +begin + Result := ImageFromSource; + fpgApplyGreyFilter(Result); +end; + function TfpgImage.ImageFromSource: TfpgImage; var x, y: TfpgCoord; -- cgit v1.2.3-70-g09d2