ScanLine[Y] - direct access to a row of pixels with a Y coordinate, allows you to quickly perform pixel-by-pixel processing of DIB images through pointers in memory (not applicable to DDB images, that is, device-dependent). When working with this property, it is necessary to take into account the size of pixels in bits (for example, for the pf1bit format, 8 pixels are located in one byte, and for the pf24bit format, three bytes are used to store one pixel). If you need to further increase the speed of accessing pixel lines, remember that you cannot simply add the resulting pointer for the top line ScanLine [0] with the size of the ScanLineSize pixel line to get the beginning of the next pixel line. The fact is that in Windows, DIB images in memory are stored upside down: first comes the bottom line, then the penultimate line, and at the very end - the top one.
ScanLineSize - returns the size of a pixel line in bytes (taking into account alignment to a double word, i.e. in Windows for an image of any size and any pixel format, the length of a pixel line must contain an integer of 4-byte words);
DibPixels[X, Y] - this property provides a slightly faster way to access image pixels than Pixels, and does not require using a canvas and creating a descriptor (but this method is still slower than through ScanLine, and especially slow for pf15bit and pf16bit formats, for which you need to convert the color of the pixel to TColor and vice versa);
DibDrawRect(DC, X, Y, R) - allows you to draw a DIB image (or part of it enclosed by rectangle R) on the target context without having to create a Handle for this operation or attach a canvas. Drawing directly is no slower than the Draw operation (and may even be faster if the device format matches the image format, so no pixel format conversion will be performed during the drawing process);
RotateRight - rotates the DIB image clockwise by 90 degrees, as a result, the width becomes the same height, and the height - the same height. This operation, like all other rotations, is performed via direct pixel access (ScanLine), and is very fast;
RotateLeft - rotates the image 90 degrees counterclockwise. There are some more methods for rotating an image, but for a specific pixel format (RotateRightMono, RotateLeftMono, RotateRight4bit, RotateLeft4bit, RotateRight8bit, RotateLeft8bit, RotateRight16bit, RotateLeft16bit, RotateRightTrueColor, RotateLeftTrueColor);
FlipVertical - quickly flips the DIB image vertically;
FlipHorizontal - quickly flips the DIB image horizontally;