Christopher Barker schrieb: Dear Chris,
Sorry it took me a while to answer back. > 1) you've got a fair bit of extra math in there that is probably already > provided by FloatCanvas -- I'd have to look closer to see exactly what, > but it sure likes you're doing too much work. Also, it looks like you're > mixing world and pixel coords: > > deltaX -= worldPosMin[0] > > or did I miss something? To be honest, i can't tell. I'm not the guy who wrote the frontend package where all of this stuff is done. I ended up the one maintaining it and wanting to improve the performance, though. ;-) As i'm not an experienced Python programmer and more or less completely new to wxPython and/or wxWidgets, this is of course a bit difficult and still involves a lot of reading up on supposingly simple concepts. As far as i understand it, the conversion seems necessary though, as the placement of the image (pixel) depends on the outer bounds of the window (world). However, i've seen the WorldToPixel method pop up ridiculously often when profiling the application, so this might indeed add to the problem. With the limited knowledge i have so far, i don't see an easy way around this, though. :-( > 2) you end up calling MoveImage with every mouse event. MoveImage > requires a complete re-draw, so that's a LOT of re-draws. This looks an > awful lot like the Move Mode that is built in, but in that mode, I move > just the buffered bitmap until the user has let go of the mouse, then do > a re-draw. Why aren't you using that? Yes, i figured the problem would be somewhere along these lines and i noticed the moving to be somewhat differently done in the Demo applications. In the MiniDemo.py i found // Nothing is changed while you are dragging. The // drawing is too slow for that. which seems to describle entirely the problem i'm facing. The implementation on the demo seems to use some moving from NavCanvas though, is this correct? Or more accurately, i noticed the moving not to be bound to anything at all, but seeming to be coming from NavCanvas in the demos. We use a FloatCanvas in the application, and as far as i understand it, i can't use the NavCanvas because i can't have the navigation bar. However, i tried several hours now to figure out how to convert the events bound to the MouseMotion/RightIsDown-Event to moving a buffered bitmap of the FloatCanvas, but didn't succeed but i do have a strong feeling that i'm just missing something simple here. Any hints on how i could get this done? > What version of FloatCanvas are you using? i recommend the latests > version from SVN, which you can find here: > > http://morticia.cs.dal.ca/FloatCanvas/ I'm currently using wxPython 2.8.7.1 and the FloatCanvas version that comes bundled with it. As this is what is deployed on all of our Systems that do any work with the underlying application, i'd like to stick with it if possible. Are there any major performance upgrades or important bugfixes in the latest Revision? -- Dipl.-Inf. Niels Menke Universität Kassel _______________________________________________ FloatCanvas mailing list [email protected] http://mail.mithis.com/cgi-bin/mailman/listinfo/floatcanvas
