[EMAIL PROTECTED] wrote: > Can I use float canvas to load a bitmap and use the zoom features on the > bitmap?
Yes. Can I also know the pixel location Yes. > and the RGB colour values? That you'll have to get yourself, once you know the pixel location. I think you can get it from a wxImage. However, it's not necessarily the ideal tool for this. FloatCanvas is really designed for vector graphics, not raster. If you want to draw vector stuff on top of your image, it would be great. Nevertheless, it should work fine, depending on your use. One issue is that when zooming, it will interpolate to whatever scale you want , so it's possible that you could get a "off by one" error in the pixel location, depending on how rounding is done. You could force it to zoom in even multiples of pixel size, but that would take a bit more tweaking. > so, can you point me to some examples of how to use float canvas and what I > need to run it? There is a TRAC site here: http://morticia.cs.dal.ca/FloatCanvas/ Not much there yet, but you can download the latest distro (or get the SVN version -- better still) It includes a bunch of small demos. There is also a link to the mailing list, if you have additional questions. (I've cc-d this to the list) You'll need wxPython 2.6 or 2.8, and numpy (1.*) Suggested strategy: You want to use a Scaledbitmap for you image. Then you want to set it up so that the "world coordinates" are the pixel coords of your image. You can do that by putting it on with something like: Canvas.AddScaledBitmap(Image, (0,0), Height = Image.GetSize()[1], Position = "tl") Where Image is a wx.Image. this aligns the top left corner of the image with (0,0), and makes it the same height in world coordinates as pixels of the image. Now if you bind mouse events to the canvas, they'll be in pixel coords, except that the y coord will be negative, as FloatCanvas uses y-positive-up by default. See the Map.py demo: http://morticia.cs.dal.ca/FloatCanvas/browser/trunk/Demos/Map.py for an example. You can reverse the Y coord as done in: http://morticia.cs.dal.ca/FloatCanvas/browser/trunk/Demos/YDownDemo.py But there may be some problems with that -- I haven't really used it, so there are some bugs in places I've assumed that y is positive up. -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception _______________________________________________ FloatCanvas mailing list [email protected] http://mail.mithis.com/cgi-bin/mailman/listinfo/floatcanvas
