Hi guys In MS Windows I use the following API functions:
1/ SetDIBits(bmap.Canvas.Handle, bmap.Handle, 0, bmap.Height, data, PBitmapInfo(bitmapInfop)^, DIB_RGB_COLORS); To set the pixels in a bitmap (bmap) using the colour data found in the specified device-independent bitmap (data) and 2/ GetDIBits(bmap.Canvas.Handle, bmap.Handle, 0, bmap.Height, data, PBitmapInfo(bitmapInfop)^, DIB_RGB_COLORS); To retrieve the bits of the specified compatible bitmap (bmap) and write same into a buffer (data) //-------------------------------------------------------- where DIB_RGB_COLORS = 0 // colour table in RGBs and PRGBQuad = ^TRGBQuad; tagRGBQUAD = packed record rgbBlue : Byte; rgbGreen : Byte; rgbRed : Byte; rgbReserved : Byte; end; TRGBQuad = tagRGBQUAD; PBitmapInfo = ^TBitmapInfo; tagBITMAPINFO = packed record bmiHeader : TBitMapInfoHeader; bmicolors : array[0..0] of TRGBQuad; end; TBitmapInfo = tagBITMAPINFO; //-------------------------------------------------------- Does anyone know how to do the same in Linux using FPC. Code must not bound only to the LCL, i.e. must function in GUI and console apps. I can do everything else, I'm not able to create the bitmap from the RGB data. Thanks Nino _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal