SetWindowPos(handle,0,0,0,WRect.Right-WRect.Left, WRect.Bottom-WRect.Top+DeltaH,SWP_NOMOVE+SWP_NOZORDER);
Expanded:=True;

PicPanel.Height := PicPanel.Height+DeltaH; if FindComponent('JLabel')=nil then

with TLabel.Create(Sender as TSavePictureBialog) do begin Parent := PicPanel;
Name := 'JLabel' ;
Caption := 'Quality';
Left := 5;
Height := 25;
Top := PaintPanel.Top+PaintPanel.Height+5;
end;
if FindComponent('JEdit1)=nil then begin
JEdit := TEdit.Create(Sender as TSavePictureBialog);
with JEdit do begin
Parent :== PicPanel;
Name: ='JEdit1;
Text := '75';
Left:=50;Width := 50;
Height := 25;
Тор := PaintPanel.Top+PaintPanel.Height+5;
end;
end;

if FindComponent{'JUpDown')=nil then

with TUpDown.Create(Sender as TSavePictureDialog) do begin Parent := PicPanel;
Name:='JUpDown';
Associate := JEdit;
Increment := 5;
Min := 1;
Max := 100;
Position := 75;
end;

if FindComponent('JCheck1)=nil then

with TCheckBox.Create(Sender as TSavePictureDialog) do begin Name: = 'JCheck' ;
Caption:='Progressive Encoding';
Parent:=PicPanel;
Left:=5;Width := PicPanel.Width - 10;
Height:=25;
Top := PaintPanel.Top+PaintPanel.Height+35;
end;
end;

end else

SavePictureDialoglClose(Sender);
end;
end;
procedure TForml.ImagelProgress(Sender: TObject;
Stage: TProgressStage;

PercentDone: Byte; RedrawNow: Boolean; const R: TRect; const Msg: String) ; begin case Stage of psStarting: begin Progressbarl.Position := 0; Progressbarl .Max := 10 0,-

end;
psEnding: begin
Progressbarl.Position := 0;
end;
psRunning: begin
Progressbarl.Position := PercentDone;
end;
end;
end;
procedure TForral.SavePictureDialoglClose(Sender: TObject) ;
var PicPanel : TPanel;
ParentHandle : THandle;
WRect : TRect;
begin
With Sender as TSavePictureBialog do begin
PicPanel := (FindComponent('PicturePanel') as TPanel);
if not Assigned(PicPanel) then Exit;
ParentHandle:=GetParent(Handle);
if ParentHandle=0 then Exit;
if FindComponent('JLabel')onil then begin
FindComponent('JLabel').Free;
FindComponent('JEdit1).Free;
ProgressiveEnc := (FindComponent('JCheck1) as TCheckBox).Checked;
FindComponent('JCheck').Free;
Quality := (FindComponent('JUpDown') as TUpDown).Position;
FindComponent('JUpDown').Free;
PicPanel.Height:=PicPanel.Height-DeltaH;
GetWindowRect(Handle,WRect);
SetWindowPos(Handle,0,0,0,WRect.Right-WRect.Left, WRect.Bottom-WRect.Top-DeltaH,SWP_NOMOVE+SWP_NOZORDER);
GetWindowRect(ParentHandle, WRect);
SetWindowPos(ParentHandle,0,0,0,WRect.Right-WRect.Left, WRect.Bottom-WRect.Top-DeltaH,SWP_NOMOVE+SWP_NOZORDER);
FilterIndex := 1;
end;
end;
end;
procedure TForml.FormCreate(Sender: TObject);
var s: string;
begin
s :=GraphicFilter(TBitmap)+' I 1+GraphicFilter(TJpeglmage);
OpenPictureDialogl.Filter := S;
SavePictureDialogl.Filter := s;
end;
procedure TForml.SavePictureDialoglShow(Sender: TObject);
begin
with Sender as TSavePictureDialog do begin
if FindComponent('JLabel')onil then begin Filterlndex := 2;
SavePictureDialoglTypeChange(Sender);
end;
end;
end;

end.

Приведенный пример может послужить толчком, во-первых, к углубленному изучению формата JPEG, а во-вторых, - к модификации стандартных диалогов. На его базе можно создать диалоги открытия аудиозаписей, документов и других специализированных видов файлов.


⇐ Предыдущая страница| |Следующая страница ⇒

Программирование в Delphi 7



Новости за месяц

  • Октябрь
    2017
  • Пн
  • Вт
  • Ср
  • Чт
  • Пт
  • Сб
  • Вс