My suggestion is no different than the other additions Robin has made that
are wxPython-specific such as the DrawPointList. The methods don't have to
be part of wxWindows. The reason for just using wxImage for now is that the
methods can be further optimized later, it won't change the API. My guess is
that a lot of the wxBitmapFromImage... code would probably get duplicated
anyway, so unless there is a major penalty for duplication of data in
memory, the existing C++ methods might as well get reused.
ka
···
-----Original Message-----
From: wxpython-users-admin@lists.wxwindows.org
[mailto:wxpython-users-admin@lists.wxwindows.org]On Behalf Of Cliff
Wells
Sent: Tuesday, February 26, 2002 12:40 PM
To: wxpython-users@lists.wxwindows.org
Subject: Re: [wxPython] scaling bitmapsOn Tue, 26 Feb 2002 11:00:26 -0800 > Kevin Altis wrote:
> If SetPIL and GetPIL calls for wxBitmap simply did the necessary wxImage
> translation at the C++ level that would probably be good enough. So,
don't
> try converting directly to wxBitmap, continue using wxImage,
but wrap all
> the necessary work in C++ instead of Python. I guess there could be
SetPIL
> and GetPIL for wxImage too. For those that don't already know the
relevant
> wiki link is:Hi Kevin,
I'm hesitant to suggest directly supporting PIL from wxPython for a couple
of reasons:
1. PIL is Python-specific (i.e. no support from the wxWindows community,
where the better C++ programmers are). If this is going to be an
efficient
translation, it'll need to be done in C++, preferably in the
wxBitmap class
and I foresee some possible resistance from the wxWindows developers to
adding Python-specific methods to their C++ code. (Unless we're going to
subclass wxBitmap and maintain the code ourselves... maybe not a
bad idea).
It would probably be easier to hack out a SetData method for wxBitmap and
submit it to the wxWindows developers.
2. PIL is not necessarily the end-all for image manipulation (although it
seems like it at the momentHaving a general-purpose SetData() method
on the wxBitmap class allows other toolkits to interface in a more
efficient fashion.
3. I don't know that having [GS]etPIL methods would be any more efficient
than a generic SetData method.Why don't you think we should skip the wxImage step? It seems that
wxImages are weak counterparts to PIL images and lose their
usefulness once
you start using PIL. wxBitmaps, on the other hand, are necessary, so it
makes sense to just cut wxImage out of the loop.> I stopped using this code because it leaks memory and I'm not exactly
sure
> where. I probably should be setting some references to None, suggestions
> welcome.It's probably something to do with using Windows. Why don't you grow up
and get a _real_ OS.
BTW, I'll try and get you those screenshots tonight (I /promise/ <crossing
>).--
Cliff Wells, Software Engineer
Logiplex Corporation (www.logiplex.net)
(503) 978-6726 x308 (800) 735-0555 x308_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwindows.org
http://lists.wxwindows.org/mailman/listinfo/wxpython-users