I need to write to each consecutive pixel of a BGRABitmap starting from the bottom left corner to the top right. (using p^.red, p^.green, p^.blue, p^.alpha). This seemed straightforward, so before setting my PBGRAPixel pointer to image.data, I set image.LineOrder := riloBottomToTop; but got the Error: No member is provided to access property.
The link
http://wiki.freepascal.org/BGRABitmap shows a Direct access to pixels example followed by the comment: Notice that the line order can be reverse, depending on the LineOrder property.
The example code shows ‘for n := bmp.NbPixels-1 downto 0 do’ but it does not change the ‘lineorder’ property, it only reverses the order of the pixel counter. i.e. if I change the code to: ‘for n := 0 to bmp.NbPixels-1 do’, I get an identical result. (which is not surprising since the pointer ‘p’ knows nothing about the counter ‘n’).
I didn’t want to use a separate scanline loop because my data is read consecutively from a MemoryStream (i.e. the input file is an XY matrix of 16bit big endian height values starting from bottom left to top right which I convert to pixel bytes).
At the moment my resulting image with the default LineOrder is upside down which I can easily flip in LazPaint but I was hoping there was a more direct way. (and without using the TrawImage method I remember from some time back). Any help is much appreciated – RWC.