zoom and scroll is slow

And if you are running at true color on Windows, Mac, Linux then you'll be
at 32-bits if you're using the default bit depth and not specifying an
explicit bit depth argument to wxImage and wxBitmap. Depending on how many
images you have kept around you could be eating up a lot of RAM, real and/or
virtual so you should look at the memory usage in Python and the OS while
the program is running. If you are paging out to disk that is going to be
slow. You could check your refcount to make sure you don't have a memory
leak too, though offhand I can't remember the syntax.

I wonder if the amount of video RAM on your video card will have any impact
on these operations. I'm not sure when using the various wxDCs, when an
operation gets put off onto the video card, if ever. Maybe it never does.

ka

···

-----Original Message-----
From: Jeff Shannon

Bob Klimek wrote:

>
> But the zooming is still slow since wxPython (or PIL) still has to
> scale the image. After clicking the zoom button 3 times, the image
> size goes from 512x512 to 4096x4096. The last zoom step takes about 2
> seconds. However, clicking the zoom one more time hangs the program
> for about 20 seconds and then prints the following traceback: ....

Well, let's presume that you're using 24-bit color bitmaps. Even if the
source bitmaps aren't that depth, I suspect that PIL and wxImage will
use at least that much internally.

4096x4096 is about 16.7 million pixels, and at 24-bit depth that's 48MB
of data. 8192x8192 is about 67 million pixels, or about 192MB of data.
Even if your machine has 256MB or more of RAM, you're likely to run
into some serious memory-handling problems -- especially considering
that, as you convert a 200MB PIL image into a 200MB wxImage, you're
using almost 400MB of memory. And don't forget that this is *only* the
raw storage for the image data, it doesn't include any other data (or
code) in your program, any other processes running on the system,
etc, etc.

It's possible that this might work on a system with 1GB or more of RAM,
but I wouldn't be surprised if the toolkits (wxPython and PIL) just
aren't capable of handling images that large.

Hi, I'm having a little trouble compiling a Python extension
(which links with wxWindows) with distutils under Windows.
I have a setup.py that's working fine under Linux, but I think
I'm screwing up the compiler flags under Windows.

Under Linux, my setup.py just grabs/parses 'wx-config --cxxflags',
so that's easy.

Is there an equivalent under Windows? How do I find the
correct set of flags? Is there an example somewhere that
I've missed?

FWIW, this is Visual C++ 6, Win2k, wxWindows 2.3.4 (compiled
from wxPythonSrc-2.3.4.2, per Robin's instructions, FINAL=1),
wxPython compiled with FINAL=1.

Not to spam the list, but here is a sample of the errors I'm
seeing (there are over 100 ...)

···

---------------

cbdraw.obj : error LNK2001: unresolved external symbol "private: void
__thiscall wxString::InitWith(char const *,unsigned int,unsigned int)"
(?InitWith@wxString@@AAEXPBDII@Z)

chset.obj : error LNK2001: unresolved external symbol "private: void
__thiscall wxString::InitWith(char const *,unsigned int,unsigned int)"
(?InitWith@wxString@@AAEXPBDII@Z)

cbdraw.obj : error LNK2001: unresolved external symbol "public: virtual
__thiscall wxBrush::~wxBrush(void)" (??1wxBrush@@UAE@XZ)

chset.obj : error LNK2001: unresolved external symbol "public: virtual
__thiscall wxBrush::~wxBrush(void)" (??1wxBrush@@UAE@XZ)

cbdraw.obj : error LNK2001: unresolved external symbol "public: __thiscall
wxBrush::wxBrush(class wxColour const &,int)"
(??0wxBrush@@QAE@ABVwxColour@@H@Z)

chset.obj : error LNK2001: unresolved external symbol "public: __thiscall
wxBrush::wxBrush(class wxColour const &,int)"
(??0wxBrush@@QAE@ABVwxColour@@H@Z)

cbdraw.obj : error LNK2001: unresolved external symbol "public: bool
__thiscall wxObject::IsKindOf(class wxClassInfo *)const "
(?IsKindOf@wxObject@@QBE_NPAVwxClassInfo@@@Z)

cbdraw.obj : error LNK2001: unresolved external symbol "public: static
class wxClassInfo wxDC::sm_classwxDC"
(?sm_classwxDC@wxDC@@2VwxClassInfo@@A)

cbdraw.obj : error LNK2001: unresolved external symbol "public: static
class wxClassInfo wxColour::sm_classwxColour"
(?sm_classwxColour@wxColour@@2VwxClassInfo@@A)

chset.obj : error LNK2001: unresolved external symbol "public: static
class wxClassInfo wxColour::sm_classwxColour"
(?sm_classwxColour@wxColour@@2VwxClassInfo@@A)

cbdraw.obj : error LNK2001: unresolved external symbol "public: virtual
unsigned long __thiscall wxPen::GetResourceHandle(void)const "
(?GetResourceHandle@wxPen@@UBEKXZ)

---------

Does that ring a bell with anyone?

Thanks,
frank

Sorry, I attached the wrong error messages ... here are the
REAL errors I'm seeing :slight_smile:

···

-----
cbdraw.obj : error LNK2001: unresolved external symbol "public: static
class wxClassInfo wxDC::sm_classwxDC"
(?sm_classwxDC@wxDC@@2VwxClassInfo@@A)

cbdraw.obj : error LNK2001: unresolved external symbol "public: static
class wxClassInfo wxColour::sm_classwxColour"
(?sm_classwxColour@wxColour@@2VwxClassInfo@@A)

chset.obj : error LNK2001: unresolved external symbol "public: static
class wxClassInfo wxColour::sm_classwxColour"
(?sm_classwxColour@wxColour@@2VwxClassInfo@@A)

cbdraw.obj : error LNK2001: unresolved external symbol "public: static
class wxClassInfo wxObject::sm_classwxObject"
(?sm_classwxObject@wxObject@@2VwxClassInfo@@A)

chset.obj : error LNK2001: unresolved external symbol "public: static
class wxClassInfo wxObject::sm_classwxObject"
(?sm_classwxObject@wxObject@@2VwxClassInfo@@A)

cbdraw.obj : error LNK2001: unresolved external symbol "public: static
class wxClassInfo wxPen::sm_classwxPen"
(?sm_classwxPen@wxPen@@2VwxClassInfo@@A)

cbdraw.obj : error LNK2001: unresolved external symbol "public: static
class wxClassInfo wxWindow::sm_classwxWindow"
(?sm_classwxWindow@wxWindow@@2VwxClassInfo@@A)

cbdraw.obj : error LNK2001: unresolved external symbol "class wxPen
wxNullPen" (?wxNullPen@@3VwxPen@@A)

chset.obj : error LNK2001: unresolved external symbol "class wxPen
wxNullPen" (?wxNullPen@@3VwxPen@@A)

cbdraw.obj : error LNK2001: unresolved external symbol "class wxCursor
wxNullCursor" (?wxNullCursor@@3VwxCursor@@A)

cbdraw.obj : error LNK2001: unresolved external symbol "public: static
class wxClassInfo wxGDIObject::sm_classwxGDIObject"
(?sm_classwxGDIObject@wxGDIObject@@2VwxClassInfo@@A)
-----

On Wed, 8 Jan 2003, Frank McIngvale wrote:

Hi, I'm having a little trouble compiling a Python extension
(which links with wxWindows) with distutils under Windows.
I have a setup.py that's working fine under Linux, but I think
I'm screwing up the compiler flags under Windows.

Under Linux, my setup.py just grabs/parses 'wx-config --cxxflags',
so that's easy.

Is there an equivalent under Windows? How do I find the
correct set of flags? Is there an example somewhere that
I've missed?

FWIW, this is Visual C++ 6, Win2k, wxWindows 2.3.4 (compiled
from wxPythonSrc-2.3.4.2, per Robin's instructions, FINAL=1),
wxPython compiled with FINAL=1.

Not to spam the list, but here is a sample of the errors I'm
seeing (there are over 100 ...)

---------------

cbdraw.obj : error LNK2001: unresolved external symbol "private: void
__thiscall wxString::InitWith(char const *,unsigned int,unsigned int)"
(?InitWith@wxString@@AAEXPBDII@Z)

chset.obj : error LNK2001: unresolved external symbol "private: void
__thiscall wxString::InitWith(char const *,unsigned int,unsigned int)"
(?InitWith@wxString@@AAEXPBDII@Z)

cbdraw.obj : error LNK2001: unresolved external symbol "public: virtual
__thiscall wxBrush::~wxBrush(void)" (??1wxBrush@@UAE@XZ)

chset.obj : error LNK2001: unresolved external symbol "public: virtual
__thiscall wxBrush::~wxBrush(void)" (??1wxBrush@@UAE@XZ)

cbdraw.obj : error LNK2001: unresolved external symbol "public: __thiscall
wxBrush::wxBrush(class wxColour const &,int)"
(??0wxBrush@@QAE@ABVwxColour@@H@Z)

chset.obj : error LNK2001: unresolved external symbol "public: __thiscall
wxBrush::wxBrush(class wxColour const &,int)"
(??0wxBrush@@QAE@ABVwxColour@@H@Z)

cbdraw.obj : error LNK2001: unresolved external symbol "public: bool
__thiscall wxObject::IsKindOf(class wxClassInfo *)const "
(?IsKindOf@wxObject@@QBE_NPAVwxClassInfo@@@Z)

cbdraw.obj : error LNK2001: unresolved external symbol "public: static
class wxClassInfo wxDC::sm_classwxDC"
(?sm_classwxDC@wxDC@@2VwxClassInfo@@A)

cbdraw.obj : error LNK2001: unresolved external symbol "public: static
class wxClassInfo wxColour::sm_classwxColour"
(?sm_classwxColour@wxColour@@2VwxClassInfo@@A)

chset.obj : error LNK2001: unresolved external symbol "public: static
class wxClassInfo wxColour::sm_classwxColour"
(?sm_classwxColour@wxColour@@2VwxClassInfo@@A)

cbdraw.obj : error LNK2001: unresolved external symbol "public: virtual
unsigned long __thiscall wxPen::GetResourceHandle(void)const "
(?GetResourceHandle@wxPen@@UBEKXZ)

---------

Does that ring a bell with anyone?

Thanks,
frank

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org

I fixed it ... albeit less that ideally: I copied the cflags
that wxPython uses to my setup.py file. I assume this means
that to do it properly I'd have to do sort of what wxPython
does when building (which I'm far too lazy to do :-).

frank

···

On Wed, 8 Jan 2003, Frank McIngvale wrote:

Sorry, I attached the wrong error messages ... here are the
REAL errors I'm seeing :slight_smile:

-----
cbdraw.obj : error LNK2001: unresolved external symbol "public: static
class wxClassInfo wxDC::sm_classwxDC"
(?sm_classwxDC@wxDC@@2VwxClassInfo@@A)

cbdraw.obj : error LNK2001: unresolved external symbol "public: static
class wxClassInfo wxColour::sm_classwxColour"
(?sm_classwxColour@wxColour@@2VwxClassInfo@@A)

chset.obj : error LNK2001: unresolved external symbol "public: static
class wxClassInfo wxColour::sm_classwxColour"
(?sm_classwxColour@wxColour@@2VwxClassInfo@@A)

cbdraw.obj : error LNK2001: unresolved external symbol "public: static
class wxClassInfo wxObject::sm_classwxObject"
(?sm_classwxObject@wxObject@@2VwxClassInfo@@A)

chset.obj : error LNK2001: unresolved external symbol "public: static
class wxClassInfo wxObject::sm_classwxObject"
(?sm_classwxObject@wxObject@@2VwxClassInfo@@A)

cbdraw.obj : error LNK2001: unresolved external symbol "public: static
class wxClassInfo wxPen::sm_classwxPen"
(?sm_classwxPen@wxPen@@2VwxClassInfo@@A)

cbdraw.obj : error LNK2001: unresolved external symbol "public: static
class wxClassInfo wxWindow::sm_classwxWindow"
(?sm_classwxWindow@wxWindow@@2VwxClassInfo@@A)

cbdraw.obj : error LNK2001: unresolved external symbol "class wxPen
wxNullPen" (?wxNullPen@@3VwxPen@@A)

chset.obj : error LNK2001: unresolved external symbol "class wxPen
wxNullPen" (?wxNullPen@@3VwxPen@@A)

cbdraw.obj : error LNK2001: unresolved external symbol "class wxCursor
wxNullCursor" (?wxNullCursor@@3VwxCursor@@A)

cbdraw.obj : error LNK2001: unresolved external symbol "public: static
class wxClassInfo wxGDIObject::sm_classwxGDIObject"
(?sm_classwxGDIObject@wxGDIObject@@2VwxClassInfo@@A)
-----

On Wed, 8 Jan 2003, Frank McIngvale wrote:

>
> Hi, I'm having a little trouble compiling a Python extension
> (which links with wxWindows) with distutils under Windows.
> I have a setup.py that's working fine under Linux, but I think
> I'm screwing up the compiler flags under Windows.
>
> Under Linux, my setup.py just grabs/parses 'wx-config --cxxflags',
> so that's easy.
>
> Is there an equivalent under Windows? How do I find the
> correct set of flags? Is there an example somewhere that
> I've missed?
>
> FWIW, this is Visual C++ 6, Win2k, wxWindows 2.3.4 (compiled
> from wxPythonSrc-2.3.4.2, per Robin's instructions, FINAL=1),
> wxPython compiled with FINAL=1.
>
> Not to spam the list, but here is a sample of the errors I'm
> seeing (there are over 100 ...)
>
> ---------------
>
> cbdraw.obj : error LNK2001: unresolved external symbol "private: void
> __thiscall wxString::InitWith(char const *,unsigned int,unsigned int)"
> (?InitWith@wxString@@AAEXPBDII@Z)
>
> chset.obj : error LNK2001: unresolved external symbol "private: void
> __thiscall wxString::InitWith(char const *,unsigned int,unsigned int)"
> (?InitWith@wxString@@AAEXPBDII@Z)
>
> cbdraw.obj : error LNK2001: unresolved external symbol "public: virtual
> __thiscall wxBrush::~wxBrush(void)" (??1wxBrush@@UAE@XZ)
>
> chset.obj : error LNK2001: unresolved external symbol "public: virtual
> __thiscall wxBrush::~wxBrush(void)" (??1wxBrush@@UAE@XZ)
>
> cbdraw.obj : error LNK2001: unresolved external symbol "public: __thiscall
> wxBrush::wxBrush(class wxColour const &,int)"
> (??0wxBrush@@QAE@ABVwxColour@@H@Z)
>
> chset.obj : error LNK2001: unresolved external symbol "public: __thiscall
> wxBrush::wxBrush(class wxColour const &,int)"
> (??0wxBrush@@QAE@ABVwxColour@@H@Z)
>
> cbdraw.obj : error LNK2001: unresolved external symbol "public: bool
> __thiscall wxObject::IsKindOf(class wxClassInfo *)const "
> (?IsKindOf@wxObject@@QBE_NPAVwxClassInfo@@@Z)
>
> cbdraw.obj : error LNK2001: unresolved external symbol "public: static
> class wxClassInfo wxDC::sm_classwxDC"
> (?sm_classwxDC@wxDC@@2VwxClassInfo@@A)
>
> cbdraw.obj : error LNK2001: unresolved external symbol "public: static
> class wxClassInfo wxColour::sm_classwxColour"
> (?sm_classwxColour@wxColour@@2VwxClassInfo@@A)
>
> chset.obj : error LNK2001: unresolved external symbol "public: static
> class wxClassInfo wxColour::sm_classwxColour"
> (?sm_classwxColour@wxColour@@2VwxClassInfo@@A)
>
> cbdraw.obj : error LNK2001: unresolved external symbol "public: virtual
> unsigned long __thiscall wxPen::GetResourceHandle(void)const "
> (?GetResourceHandle@wxPen@@UBEKXZ)
>
> ---------
>
> Does that ring a bell with anyone?
>
> Thanks,
> frank
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
> For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org