I rebuild my PC from Win 2K Pro to Win XP Pro. I'm using Delphi 7. I installed GFL SDK v2.4 and have libgfl240.dll, libgfle240.dll and qtintf70.dll in my Delphi project folder.
The code appearing below used to work fine on Win 2K Pro but now on Win XP Pro, I get the following compiling error on the last line in the code.
[Error] UserSessionUnit.pas(234): Incompatible types: 'TGFL_BITMAP' and 'PGFL_BITMAP'
Please help.
Regards,
Nols Smit
Code: Select all
procedure TIWUserSession.ConvertImage;
var
sFileName, sFilePathName: string;
j:integer;
width, new_width, height, new_height: cardinal;
lp: TGFL_LOAD_PARAMS;
sp: TGFL_SAVE_PARAMS;
gfl_bmp: PGFL_BITMAP;
e,f: GFL_ERROR;
format: string;
ConvertError: boolean;
begin
SmallMs.Clear;
gflEnableLZW(GFL_TRUE);
ConvertError := false;
if ImageFilePathName <> '' then
begin
gflGetDefaultLoadParams(lp);
e := gflLoadBitmap(Pchar(ImageFilePathName), gfl_bmp, lp, finfo);
if (e <> gfl_no_error) then
begin
ConvertError := true;
WebApplication.ShowMessage('File not an image: ' + string(gflGetErrorString(e)), smAlert);
end;
if not ConvertError then
begin
width := finfo.Width;
height := finfo.Height;
if width > height then
begin
new_width := rgrpSizeItems;
new_height := Round((new_width / width) * height);
end
else
begin
new_height := rgrpSizeItems;
new_width := Round((new_height / height) * width);
end;
gflResize(gfl_bmp, nil, new_width, new_height, GFL_RESIZE_BILINEAR, 0);
j := 0; {jpg}
format := gflGetDefaultFormatSuffixByIndex(j);
gflGetDefaultSaveParams(sp);
sp.FormatIndex := j;
if j = 0 then
begin
sp.Quality := edtQualityText;
sp.Flags := GFL_SAVE_ANYWAY;
end;
sFileName := WebApplication.AppID + '_' + IntToStr(Random(1000)) + '.jpg';
sFilePathName := gsAppPath + '\Files\' + sFileName;
f := gflSaveBitmap(PChar(sFilePathName),gfl_bmp^, sp);
..
..