Page 1 of 1

Batch resize? [Delphi]

Posted: Tue Nov 02, 2004 6:57 pm
by The Re@l

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;
Hello

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

Re: Batchresize? [Delphi]

Posted: Wed Nov 03, 2004 1:48 pm
by xnview
The Re@l wrote: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.?
What's happened?

Posted: Wed Nov 03, 2004 3:54 pm
by The Re@l
Hi

Nothing Happens,

or

Error mesage: File not Readable : Error to open File.

But I can´t see whats wrong.

Posted: Wed Nov 03, 2004 4:37 pm
by The Re@l
Ok it works.

My mistake. :)