Page 1 of 1

gflConvertBitmapIntoDDB

Posted: Sun Oct 17, 2010 6:24 pm
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