Opened 10 years ago

Closed 5 years ago

#9381 closed enhancement (fixed)

Better access to bitmap mask data

Reported by: gverbruggen Owned by:
Priority: normal Milestone:
Component: GUI-all Version:
Keywords: wxBitmap wxMask Cc: gverbruggen, vadz
Blocked By: Blocking:
Patch: no


Currently it is not possible to access a the content of a wxMask.

A mask can always be created from a bitmap, but an existing mask cannot be manipulated.
In the wxMSW port, wxBitmap has a method GetMaskBitmap, which allows to work around this problem
(extract the mask as a bitmap, manipulate the bitmap and create a new mask from the bitmap).
However other ports (at least wxGTK) do not have this method.

More specific, I am looking for a way to tile a number of bitmaps with masks into another larger bitmap, also having a mask. The masks of the source bitmaps should be copied into the mask of the target bitmap.
(as far as I can see, the Blit operation takes into account the source mask, but it does not modify the mask
of the target)

A GetBitmap method on wxMask, returning the mask as a monochrome bitmap, would solve the problem.

Change History (3)

comment:1 Changed 9 years ago by vadz

Implementing this should be possible under wxGTK too (we have GdkBitmap in the mask and we need to create GdkPixmap from it, shouldn't be difficult) and I agree that not being able to access the mask is strange.

comment:2 Changed 9 years ago by wojdyr

  • Component set to GUI-all
  • Keywords wxBitmap wxMask added
  • Status changed from new to confirmed

comment:3 Changed 5 years ago by PC

  • Resolution set to fixed
  • Status changed from confirmed to closed

(In [73409]) add wxMask::GetBitmap(), closes #9381

Note: See TracTickets for help on using tickets.