When trying to convert Bitmap manipulation stuff using Scanline from Delphi to Freepascal / Lazarus Opbitmap might help you. http://www.theo.ch/lazarus/opbitmap64.zip If you are not on 32 bit intel install the opbitmapforlazcompat.lpk package. The demos should get you going. I don't know if this is what you need.