From: Alex T. <al...@tw...> - 2005-11-30 11:34:51
|
Mauro Cherubini wrote: > Thanks Alex for the quick answer! > > Actually, when I say existing bitmap I mean an external png file that > represent a geographical map. > What I want to do is to add to this map some "dots" and "lines" at > specific locations according to some logic I have in the rest of the > program. > > I did this using PIL, editing the existing bitmap and saving the > results into a new file. I was hoping to do the same with PythonCard, > maybe working on a transparent canvas which should overlay the > existing bitmap. But I cannot figure out the way to do it. > Is the end result just to display it ? Or do you need to save a new PNG file ? If display on screen is what you want, then it should (maybe) be easy. I doubt if your idea of using an Image and a bitmapCanvas will work - you'd need transparency of the bitmapCanvas which I don't think is supported. What you should be able to do is something like (you'll need "from PythonCard import graphic" if you don't already have it). backimage = graphic.Bitmap('D:/Our Documents/Alex/a.png') self.components.bufOff.drawBitmap(backimage, (0,0)) and then do additional drawing on top of that. If you then need to save that to a new PNG file, it can probably be done - investigate the functions within graphic.py - though I've not done anything like that. -- 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.10/188 - Release Date: 29/11/2005 |