Difference between GetPixel and Canvas.Pixels in Delphi

Is the Api "GetPixel" function faster than Canvas.Pixels?

+5
source share
3 answers

It should be the same:

function TCanvas.GetPixel(X, Y: Integer): TColor;
begin
  RequiredState([csHandleValid]);
  GetPixel := Windows.GetPixel(FHandle, X, Y);
end;
+6
source

If you are looking for something that works better than GetPixel / Canvas.Pixel [], you should check Bitmap.ScanLine. Only problem is that data can be organized in several ways defined by Bitmap.PixelFormat

+4
source

GetPixel ! ( ) , ScanLine. ScanLine [y] - y- , , PixelFormat. , 24-

B1 G1 R1 B2 G2 R2... Bn Gn Rn

n. Bi, Gi Ri - , , .

0
source

All Articles