From: Alex T. <al...@tw...> - 2005-11-29 18:20:50
|
Mauro Cherubini wrote: > Dear All, > > sorry for the newbie question but I am fighting with the following > issue: > I am trying to add some drawing on top of an existing bitmap. When you say "existing bitmap" do you mean an existing bitmapCanvas component ? > I tried two things: the first one was to draw directly on the image > setting that as the working canvas (i.e., canvas = > self.components.canvasBackground); the second was to draw on a > separate canvas. > > The first attempt raised an exception because apparently is not > possible to draw on bitmaps. You should be able to do this. If you didn't already, see the 'gravity' example in the samples directory (or any of the other samples that use bitmapCanvas). If you still have a problem with this, post again maybe including the code that is failing ... (if you do - please try to give us a complete, small example including resource file). > The second attempt load the drawing canvas on top of the "background" > bitmap and because it is not transparent it covers automatically the > background. > Don't think you can get transparent bitmapCanvas. > I tried to set the 'backgroundColor' to 'None' but without success > (it says that 'AttributeError: 'BitmapCanvas' object has no attribute > 'backgroundColour''). > You may not be able to set it to None - but you can set the backgroundColor (was it a mis-spelling as backgroundColour ??) I added : self.components.bufOff.backgroundColor = (255,255,0) to the on_initialize of the gravity example and it worked beautifully (maybe that's the wrong word for a bright yellow background :-) -- Alex Tweedly http://www.tweedly.net -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.362 / Virus Database: 267.13.8/183 - Release Date: 25/11/2005 |