(x+1,y) since you don't know if (x,y) is transparent or not. Second,
use x*(numColBytes+1) instead of just x to offset into the first
line.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22368
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
png_uint_32 x, png_uint_32 y, png_uint_32 w, png_uint_32 h,
size_t numColBytes)
{
- // we start from (x + 1, y)
- x++;
-
// suppose that a mask will suffice and check all the remaining alpha
// values to see if it does
for ( ; y < h; y++ )
{
- unsigned const char *ptr = lines[y] + x;
+ // each pixel is numColBytes+1 bytes, offset into the current line by
+ // the current x position
+ unsigned const char *ptr = lines[y] + (x * (numColBytes + 1));
for ( png_uint_32 x2 = x; x2 < w; x2++ )
{