Page 1 of 1

GFLRotate

Posted: Wed Nov 26, 2008 1:46 pm
by ber
Hi,
I am using Delphi . I have a problem with GFLRotate.

Code: Select all

procedure TImageViewForm.vb1Click(Sender: TObject);
var
  InformationFichier: TGFL_File_Information;
  LoadParam          : TGFL_Load_Params;
//  spr                : TGFL_SAVE_PARAMS;
  Erreur                 : GFL_Error;
  GFLImage           : PGFL_Bitmap;
  gfl_bmp_dst: PPGFL_BITMAP;
  Rotation :integer;
  filename: string;
  Pgfl_colorRotar: TGFL_COLOR;
begin
  OpenDialog.Filter := GflFilterString;
  if not OpenDialog.Execute then
    exit;
  filename := OpenDialog.Filename;
  Pgfl_colorRotar.Red := 0;
  Pgfl_colorRotar.Green := 0;
  Pgfl_colorRotar.Blue := 0;
  Pgfl_ColorRotar.Alpha := 0;
  Rotation := Rotation +90;
  if Rotation > 270 then Rotation := 0;
  gflGetDefaultLoadParams(LoadParam);
  LoadParam.Flags := GFL_LOAD_METADATA;
  Erreur := gflLoadBitmap(PChar(filename), GFLImage, LoadParam, InformationFichier);
  GFLRotate(GFLImage,nil, 180 ,Pgfl_colorRotar);
//  f := gflSaveBitmap(PChar(filename),GFLImage, LoadParam );
end;

Posted: Wed Nov 26, 2008 2:55 pm
by dominique
I use it with c++builder whitout problem perhaps you should first test the variable Erreur after gflLoadBitmap to be shure that the bitmap is well loaded. It must be equal to 0 (GFL_NO_ERROR).
It's better if you precise the type of error too to help debugging

Posted: Thu Nov 27, 2008 8:14 am
by ber
No error message but don't working...

Code: Select all

procedure TImageViewForm.vb1Click(Sender: TObject);
var
  InformationFichier: TGFL_File_Information;
  LoadParam          : TGFL_Load_Params;
  spr                : TGFL_SAVE_PARAMS;
  Erreur ,f                : GFL_Error;
  GFLImage          : PGFL_Bitmap;
  gfl_bmp_dst: PPGFL_BITMAP;
  Rotation :integer;
  filename: string;
  Pgfl_colorRotar: TGFL_COLOR;
begin
  OpenDialog.Filter := GflFilterString;
  if not OpenDialog.Execute then
    exit;
  filename := OpenDialog.Filename;
  Pgfl_colorRotar.Red := 255;
  Pgfl_colorRotar.Green := 255;
  Pgfl_colorRotar.Blue := 255;
  Pgfl_ColorRotar.Alpha := 0;
  Rotation := 90;
  if Rotation > 270 then Rotation := 0;
  gflGetDefaultLoadParams(LoadParam);
  LoadParam.Flags := GFL_LOAD_METADATA;
  Erreur := gflLoadBitmap(PChar(filename), GFLImage, LoadParam, InformationFichier);
  ShowMessage(IntToStr(Erreur));  //  0 No error
  GFLRotate(GFLImage,nil,  Rotation ,Pgfl_colorRotar);
  gflGetDefaultSaveParams(spr);
  spr.Flags:=GFL_SAVE_REPLACE_EXTENSION;
  spr.FormatIndex:=gflGetFormatIndexByName('jpg');
  spr.Compression:=GFL_LZW;
  spr.CompressionLevel:=7;
  spr.Quality:=75;
  f := gflSaveBitmap(PChar(filename),GFLImage , spr );
end;

Posted: Sat Nov 29, 2008 10:07 am
by dominique
In I use gflRotateFine but I test gflRotate without problem in C++Builder. Perhaps someone else can test with Delphi to help ber?