Image creation

O

Odalrick

I need to generate wx.Bitmap with a hole in them, i.e. the whole bitmap
is one colour, greyish with alpha = 255*.6, except for one rectangle
that has alpha = 0 .

Currently I'm doing this with PIL, thus:

def _init_mask( self ):
mask = Image.new( 'RGBA', self.size, color=options['mask_colour'] )
draw = ImageDraw.Draw( mask )
draw.rectangle( self.clip_area.box, fill=( 255, 255, 255, 0) )
self._mask = pilToBitmap( mask, alpha=True )

Obviously this is inefficient, but I couldn't find any way to give
alpha values with wxPython's image objects and premature optimization
etcetera... Well, now the program works, but is a bit sluggish so I'm
asking if anyone can give me some pointers to speeding this up.

/Odalrick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top