Retief, I don't have time to go through this thoroughly now, but a couple comments:
> The demo supports very basic Layers and LayerManager. cool. Is it an altered FloatCanvas, or something all new? > I saw you asked about speed comparison with GC and wx.MemoryDC. In my > demo I first paint to a MemoryDC using the GC and then Blit to > Bitmap. Similar to how fc works. Any better way of doing this with > GC? not that I know of, though the double buffering may not be helpful on all platforms, as some ore double buffering anyway (OS-X for sure). > The Transform matrix (1,0,0,1,0,0) nicely converts from screen to > world co-ordinates, and simply multiply the matrix be the zoom factor > and everything is draw correctly. Yes, that could make things easier. > Except text which is mirrored and > upside down, but is what the transformation matrix should do to text. hmm. I'm not sure either. > The demo is currently drawing about 360 (60x [Polygon, Circle, > Rectangle, RoundedRegtangle, Line, Text]) objects which takes about > 2.4 secs to draw. Is this slow compared to fc? Yes, much slower :-( FC is quite speedy until you get to 1000s of objects. What platform is this on? That could make a big difference. > Any ideas to speed it up. None. This may ultimately require a dual-mode approach, only using GC when we really need it's features -- though I suspect it will get faster with future versions. > Notes on Layers and Layermanager (please comment). Each layer should > be draw to its own bitmap. Only layers that are dirty then gets > redrawn. All the bitmaps can then be Blited together (can this be > done). Well, that was my first idea when I added the "foreground" layer -- if two, why not n layers? But wxBitmap didn't support transparency, and the time to make a mask, then draw a bitmap with a mask was HUGE -- it made no sense. That's why the foreground layer isn't buffered now (also because the whole point of it is that things are changing frequently there. With GC, and newer wxBitmaps that support transparency, maybe this will now work. However, is fair bit of memory for each layer. In many drawing and GIS programs, there can be a LOT of layers, so it may be better if they aren't all buffered. > Questions about panning. How can one get the panning to only Draw the > parts that was not shown before the pan operation started? Or only > show the part that was visible when the operation started (this is > probably the best option)? That's what FloatCanvas does now, and it's easy, as you just draws the existing buffer in a different place. I do have some ugly code that fills in the background color around the moving image too. However, I've though about making that better. By keeping track of the move, you could have a new BoundingBox for the area that needs to be re-drawn, so you could only draw stuff that needs re-drawing. combining that with setting a clipping region, and you could make sure only what really needs to be drawn is. That may not really save much however, as people tend to move the image a fair bit at once, but if you had lots of small objects, it could make a difference. Thanks for all this -- I think this may well come to something! -CHB -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception [EMAIL PROTECTED] _______________________________________________ FloatCanvas mailing list [email protected] http://mail.mithis.com/cgi-bin/mailman/listinfo/floatcanvas
