gflConvertBitmapIntoDDB

Discussions on GFL SDK, the graphic library for reading and writing graphic files

Moderators: XnTriq, helmut, xnview

User avatar
madiazg
Posts: 82
Joined: Wed Jul 18, 2007 8:00 pm
Location: Tenerife - Islas Canarias

gflConvertBitmapIntoDDB

Post by madiazg »

I am using the following code to display an image:

Code: Select all

var
  bmp: TBitmap; // Bitmap
  hBmp: HBitmap;
begin
  Bmp := TBitmap.Create;
  TRY
    Bmp.PixelFormat := pf24bit;
    Bmp.Width  := gfl_bmp.Width;
    Bmp.Height := gfl_bmp.Height;
    hBmp := bmp.Handle;
    gflConvertBitmapIntoDDB(gfl_bmp,hBmp);
    Imagen.Picture.Graphic := Bmp; //Muestra la imagen
  FINALLY
    Bmp.Free; //Libera Memoria
  END;
end;
The image shows completely blank. Can you tell me I'm doing wrong?

The code I use now and I want to replace gflConvertBitmapIntoDDB is:

Code: Select all

    FOR j := 0 TO Bmp.Height-1 DO
    BEGIN
      Row := Bmp.Scanline[j];
      FOR i := 0 TO Bmp.Width-1 DO
      BEGIN
        gflGetColorAt(gfl_bmp,i,j,Pgfl_color);
        WITH Row[i] DO
        BEGIN
          rgbtRed   := pgfl_color.Red;
          rgbtGreen := pgfl_color.Green;
          rgbtBlue  := pgfl_color.Blue;
        END
      END
    END;
Regards...
Miguel Angel