![]() Let’s assume a small VGA sized bitmap, so we get 480 lines with 640 pixels each. Then it enumerates through all the lines in the input bitmap and then all the pixels in that line, reads them does “something” with them and finally writes them to the corresponding pixel in the output bitmap. ![]() This code first checks that the input bitmap is using 24 bits per pixel, then sets the output bitmap to do the same. PRgbTripleArray(_OutBmp.Scanline)^ := Pixel Pixel := PRgbTripleArray(_InBmp.Scanline)^ _OutBmp.SetSize(_InBmp.Width, _InBmp.Height) Procedure ConvertBmp(_InBmp, _OutBmp: TBitmap) TRgbTripleArray = packed array of TRgbTriple do not change the order of the fields, do not add any fields As you will find in the documentation and on the web the usual way to access the pixels of a Bitmap in Delphi is using the Scanline array property.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |