LCL: Fix compilation issue with fpc 3.0.2 (TJpegImage.GrayScale).

git-svn-id: trunk@59059 -
This commit is contained in:
wp 2018-09-17 23:41:41 +00:00
parent b64daa1f84
commit 9deac7b246
4 changed files with 10 additions and 3 deletions

View File

@ -13,10 +13,10 @@ object Form1: TForm1
Height = 585
Top = 31
Width = 676
ActivePage = PgRead
ActivePage = PgWrite
Align = alClient
BorderSpacing.Around = 4
TabIndex = 0
TabIndex = 1
TabOrder = 0
object PgRead: TTabSheet
Caption = 'Read'

View File

@ -135,7 +135,9 @@ begin
try
jpeg.LoadFromFile(filename);
jpeg.CompressionQuality := SbQuality.Position;
{$IF FPC_FullVersion >= 30400}
jpeg.GrayScale := CbGrayScale.Checked;
{$IFEND}
jpeg.ProgressiveEncoding := CbProgressive.Checked;
jpeg.SaveToFile(newFileName);
finally
@ -169,6 +171,9 @@ begin
LblProgressive.Caption := '';
BtnReadClick(nil);
SbQualityChange(nil);
{$IF FPC_FullVersion >= 30400}
CbGrayScale.Enabled := false;
{$ENDIF}
end;
function TForm1.GetFileName: String;

View File

@ -1784,7 +1784,7 @@ type
class function GetFileExtensions: string; override;
public
property CompressionQuality: TJPEGQualityRange read FQuality write SetCompressionQuality;
property GrayScale: Boolean read FGrayScale write SetGrayScale;
property GrayScale: Boolean read FGrayScale {$IF FPC_FullVersion >= 30400} write SetGrayScale{$IFEND};
property MinHeight: Integer read FMinHeight write FMinHeight;
property MinWidth: Integer read FMinWidth write FMinWidth;
property ProgressiveEncoding: boolean read FProgressiveEncoding write SetProgressiveEncoding;

View File

@ -95,7 +95,9 @@ begin
if not(AWriter is TFPWriterJPEG) then Exit;
TFPWriterJPEG(AWriter).ProgressiveEncoding := ProgressiveEncoding;
TFPWriterJPEG(AWriter).CompressionQuality := CompressionQuality;
{$IF FPC_FullVersion >= 30400}
TFPWriterJPEG(AWriter).GrayScale := GrayScale;
{$IFEND}
end;
procedure TJPEGImage.SetCompressionQuality(AValue: TJPEGQualityRange);