Fix creating a bitmap representing wxMask
When bitmap data are accessed with wxNativePixelData, which is designed to handle RGB bitmaps, Alpha() function cannot be used because in this case alpha component index is set to the default value -1 and actually the blue component of the "preceding" pixel is accessed. Closes #18478.
This commit is contained in:
@@ -1697,10 +1697,8 @@ wxBitmap wxMask::GetBitmap() const
|
||||
for (int x = 0; x < m_width; ++x, ++p, ++src)
|
||||
{
|
||||
const unsigned char byte = *src;
|
||||
p.Alpha() = 0xff;
|
||||
p.Red() = byte;
|
||||
p.Green() = byte;
|
||||
p.Blue() = byte;
|
||||
wxASSERT( byte == 0 || byte == 0xFF );
|
||||
p.Red() = p.Green() = p.Blue() = byte;
|
||||
}
|
||||
p = rowStart;
|
||||
p.OffsetY(data, 1);
|
||||
|
Reference in New Issue
Block a user