diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-02-12 15:31:18 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-02-12 18:29:47 +0100 |
commit | 457204cfce253450283de1c96b9178f4d9246405 (patch) | |
tree | 0182c7fffc3b836acab598f7d276182821c85578 /include | |
parent | ac97ca547de9593ff5f8e7615f1aa779a5091126 (diff) |
fix pixel address calculation in RawBitmap
Change-Id: I42476a8049330ff02c555ecba49b49f3cf012086
Reviewed-on: https://gerrit.libreoffice.org/49599
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include')
-rw-r--r-- | include/vcl/BitmapTools.hxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/vcl/BitmapTools.hxx b/include/vcl/BitmapTools.hxx index 6339994a285d..6dc88967526e 100644 --- a/include/vcl/BitmapTools.hxx +++ b/include/vcl/BitmapTools.hxx @@ -19,7 +19,7 @@ namespace vcl { namespace bitmap { /** - * intended to be used to feed into CreateFromData to create a BitmapEx + * Intended to be used to feed into CreateFromData to create a BitmapEx. RGB data format. */ class VCL_DLLPUBLIC RawBitmap { @@ -34,7 +34,7 @@ public: } void SetPixel(long nY, long nX, BitmapColor nColor) { - long p = nY * maSize.getWidth() + nX; + long p = (nY * maSize.getWidth() + nX) * 3; mpData[ p++ ] = nColor.GetRed(); mpData[ p++ ] = nColor.GetGreen(); mpData[ p ] = nColor.GetBlue(); |