Discussion:
wxImage sizeof pixel
(too old to reply)
Todd Mars
2009-05-22 17:39:14 UTC
Permalink
HI!

Is this true for now? (correct I mean) To get byte size of pixel data
in wxImage:

int GetPixelSize(wxImage &img)
{

if (img.HasAlpha())
return 4;
return 3;
}

Thanks!
Todd.
Todd Mars
2009-05-22 17:43:39 UTC
Permalink
Post by Todd Mars
HI!
Is this true for now? (correct I mean) To get byte size of pixel data
int GetPixelSize(wxImage &img)
{
        if (img.HasAlpha())
                return 4;
        return 3;
}
Thanks!
Todd.
I mean as stored in wxImage, or is the 'Alpha' channel a seperate
array, seperate from the data?
Phillip Seaver
2009-05-22 17:51:40 UTC
Permalink
Post by Todd Mars
Post by Todd Mars
HI!
Is this true for now? (correct I mean) To get byte size of pixel data
int GetPixelSize(wxImage &img)
{
if (img.HasAlpha())
return 4;
return 3;
}
Thanks!
Todd.
I mean as stored in wxImage, or is the 'Alpha' channel a seperate
array, seperate from the data?
They're separate. See the documentation for GetAlpha() and GetData():
http://docs.wxwidgets.org/stable/wx_wximage.html#wximagegetalpha

Phillip

Loading...