Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Catalog · How the catalog works

Random project

FastBMP

A lightweight delphi wrapper for fast pixel access

View on GitHub

Anyone may press Interesting, signed in or not. It helps others find this project.

Member rating

No ratings yet.

Sign in to rate this project.

README

FastBMP

A lightweight wrapper for direct pixel data access. The current implementation is limited to 32-bit Bitmap (best memory alignment) and will enforce this pixel format.

Usage

You can attach to an existing Bitmap and use it like a wrapper.

pascal
LBMP:= TFastBMP.Create(0,0);
LBMP.AttachToBitmap(Image1.Picture.Bitmap);
//Pixel access code
Image1.Repaint;

Create your own Bitmap

pascal
LBMP:= TFastBMP.Create(640,480);

Or copy an existing Bitmap

pascal
LBMP:= TFastBMP.Create(Image1.Picture.Bitmap);

Afterwards, you can access the pixels with

pascal
LBMP.Pixels[42,42].R:= 42;

This works around 1000 times faster than the access through Bitmap.Canvas.Pixels, since it makes use of ScanLine.

Future plans

  • support for several pixel formats