set depth to 32 when creating pixbuf from wxImage with alpha; correct a few comments

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40812 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Paul Cornett 2006-08-25 06:27:34 +00:00
parent 777dffec69
commit d0e7975501

View File

@ -84,7 +84,7 @@ bool wxMask::Create( const wxBitmap& bitmap,
// one bit per pixel, each row starts on a byte boundary
const size_t out_size = size_t((w + 7) / 8) * unsigned(h);
wxByte* out = new wxByte[out_size];
// set bits are white
// set bits are unmasked
memset(out, 0xff, out_size);
unsigned bit_index = 0;
if (bitmap.HasPixbuf())
@ -496,7 +496,7 @@ bool wxBitmap::CreateFromImageAsPixmap(const wxImage& image, int depth)
// one bit per pixel, each row starts on a byte boundary
const size_t out_size = size_t((w + 7) / 8) * unsigned(h);
wxByte* out = new wxByte[out_size];
// set bits are white
// set bits are black
memset(out, 0xff, out_size);
const wxByte* in = image.GetData();
unsigned bit_index = 0;
@ -580,7 +580,7 @@ bool wxBitmap::CreateFromImageAsPixbuf(const wxImage& image)
wxASSERT( gdk_pixbuf_get_width(pixbuf) == width );
wxASSERT( gdk_pixbuf_get_height(pixbuf) == height );
SetDepth(wxTheApp->GetGdkVisual()->depth);
SetDepth(32);
SetPixbuf(pixbuf);
// Copy the data:
@ -646,7 +646,7 @@ wxImage wxBitmap::ConvertToImage() const
GdkPixmap* pixmap_invert = NULL;
if (GetDepth() == 1)
{
// mono bitmaps are inverted
// mono bitmaps are inverted, i.e. 0 is white
pixmap_invert = gdk_pixmap_new(pixmap, w, h, 1);
GdkGC* gc = gdk_gc_new(pixmap_invert);
gdk_gc_set_function(gc, GDK_COPY_INVERT);