|
@@ -79,6 +79,7 @@ type
|
|
|
panelButtons: TPanel;
|
|
panelButtons: TPanel;
|
|
|
ifJpeg_ProgressiveEncoding: TCheckBox;
|
|
ifJpeg_ProgressiveEncoding: TCheckBox;
|
|
|
procedure FormCreate(Sender: TObject);
|
|
procedure FormCreate(Sender: TObject);
|
|
|
|
|
+ procedure ifBmp_BitsPerPixelChange(Sender: TObject);
|
|
|
procedure ifBmp_GrayScaleChange(Sender: TObject);
|
|
procedure ifBmp_GrayScaleChange(Sender: TObject);
|
|
|
private
|
|
private
|
|
|
curFormat: TBGRAImageFormat;
|
|
curFormat: TBGRAImageFormat;
|
|
@@ -263,6 +264,8 @@ end;
|
|
|
function TBGRAFormatUIContainer.GetControlValue(var AValue: TValue; const AControl: TControl): Boolean;
|
|
function TBGRAFormatUIContainer.GetControlValue(var AValue: TValue; const AControl: TControl): Boolean;
|
|
|
begin
|
|
begin
|
|
|
Result:= False;
|
|
Result:= False;
|
|
|
|
|
+
|
|
|
|
|
+ if AControl.Enabled then
|
|
|
try
|
|
try
|
|
|
//Types will be added as we use them,
|
|
//Types will be added as we use them,
|
|
|
//it is the responsibility of the UI creator not to put in crap like
|
|
//it is the responsibility of the UI creator not to put in crap like
|
|
@@ -404,6 +407,19 @@ begin
|
|
|
end;
|
|
end;
|
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
|
|
+procedure TBGRAFormatUIContainer.FormCreate(Sender: TObject);
|
|
|
|
|
+var
|
|
|
|
|
+ i: Integer;
|
|
|
|
|
+
|
|
|
|
|
+begin
|
|
|
|
|
+ //Bitmap Format
|
|
|
|
|
+ oldBmp_BitsPerPixel:= -1;
|
|
|
|
|
+
|
|
|
|
|
+ //Fill Bits x Pixels Objects Values
|
|
|
|
|
+ for i:=0 to ifBmp_BitsPerPixel.Items.Count-1 do
|
|
|
|
|
+ ifBmp_BitsPerPixel.Items.Objects[i]:= TObject(PtrUInt(BMP_BitsValidValues[i]));
|
|
|
|
|
+end;
|
|
|
|
|
+
|
|
|
procedure TBGRAFormatUIContainer.ifBmp_GrayScaleChange(Sender: TObject);
|
|
procedure TBGRAFormatUIContainer.ifBmp_GrayScaleChange(Sender: TObject);
|
|
|
begin
|
|
begin
|
|
|
if ifBmp_GrayScale.Checked
|
|
if ifBmp_GrayScale.Checked
|
|
@@ -411,26 +427,17 @@ begin
|
|
|
oldBmp_BitsPerPixel:= ifBmp_BitsPerPixel.ItemIndex;
|
|
oldBmp_BitsPerPixel:= ifBmp_BitsPerPixel.ItemIndex;
|
|
|
ifBmp_BitsPerPixel.ItemIndex:= 2; //GrayScale
|
|
ifBmp_BitsPerPixel.ItemIndex:= 2; //GrayScale
|
|
|
end
|
|
end
|
|
|
- else begin
|
|
|
|
|
- if (oldBmp_BitsPerPixel > -1) then ifBmp_BitsPerPixel.ItemIndex:= oldBmp_BitsPerPixel;
|
|
|
|
|
- end;
|
|
|
|
|
|
|
+ else if (oldBmp_BitsPerPixel > -1)
|
|
|
|
|
+ then ifBmp_BitsPerPixel.ItemIndex:= oldBmp_BitsPerPixel;
|
|
|
|
|
|
|
|
ifBmp_RLECompress.Enabled:= ifBmp_GrayScale.Checked;
|
|
ifBmp_RLECompress.Enabled:= ifBmp_GrayScale.Checked;
|
|
|
ifBmp_BitsPerPixel.Enabled:= not(ifBmp_GrayScale.Checked);
|
|
ifBmp_BitsPerPixel.Enabled:= not(ifBmp_GrayScale.Checked);
|
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
-procedure TBGRAFormatUIContainer.FormCreate(Sender: TObject);
|
|
|
|
|
-var
|
|
|
|
|
- i: Integer;
|
|
|
|
|
-
|
|
|
|
|
|
|
+procedure TBGRAFormatUIContainer.ifBmp_BitsPerPixelChange(Sender: TObject);
|
|
|
begin
|
|
begin
|
|
|
- //Bitmap Format
|
|
|
|
|
- oldBmp_BitsPerPixel:= -1;
|
|
|
|
|
-
|
|
|
|
|
- //TO-DO: Does not works test better tomorrow
|
|
|
|
|
- //Fill Bits x Pixels Objects Values
|
|
|
|
|
- for i:=0 to ifBmp_BitsPerPixel.Items.Count-1 do
|
|
|
|
|
- ifBmp_BitsPerPixel.Items.Objects[i]:= TObject(PtrUInt(BMP_BitsValidValues[i]));
|
|
|
|
|
|
|
+ ifBmp_RLECompress.Enabled:= (ifBmp_BitsPerPixel.ItemIndex in [1,2]);
|
|
|
|
|
+ ifBmp_GrayScale.Enabled:= (ifBmp_BitsPerPixel.ItemIndex = 2);
|
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
function TBGRAFormatUIContainer.AdjustPanels: Boolean;
|
|
function TBGRAFormatUIContainer.AdjustPanels: Boolean;
|