Code: Select all
var
i:integer;
filename1, filename: string;
finfo: TGFL_FILE_INFORMATION;
lp: TGFL_LOAD_PARAMS;
sp: TGFL_SAVE_PARAMS;
gfl_bmp: PGFL_BITMAP;
e,f: GFL_ERROR;
format: string;
begin
   if not DirectoryExists(edit1.text) then MkDir(edit1.text);
   if edit1.Text <>'' then begin
    For i := 0 to FileListBox1.Items.Count - 1 do
      begin
    filename1 := (edit1.text +      ExtractFileName(FileListBox1.Items.Strings[i]));
    filename := FileListBox1.FileName;
    If FileListBox1.FileName <> '' then
    begin
     gflGetDefaultLoadParams(lp);
     e := gflLoadBitmap(Pchar(filename), gfl_bmp, lp, finfo);
    if (e <> gfl_no_error) then begin
    MessageDlg('File not readable: ' + string(gflGetErrorString(e)), mtError, [mbOK], 0);
    exit;
  end;
     gflResize(gfl_bmp, nil, StrToInt(edit2.text), StrToInt(edit3.text), GFL_RESIZE_BILINEAR, 0);
      format := finfo.FormatName;
      gflGetDefaultSaveParams(sp);
      sp.FormatIndex := gflGetFormatIndexByName(PChar(format));
       f := gflSaveBitmap(PChar(filename1 + '.' + format),gfl_bmp, sp);
        gflFreeBitmap(gfl_bmp);
            end;
             end;
              end;
               end;
I´ve try to resize all files in the Filelistbox, but it doesn`t seem to work.
Please, can you help me? what´s wrong.?
Best regards
The Re@l

