On 6/1/07, Christopher Barker <[EMAIL PROTECTED]> wrote: > Andrea Gavana wrote: > > Yes, I thought about FloatCanvas. Probably I don't know it very well, > > but my one of my requirements was to be able to have a legend for the > > lines plotted, and as far as I remember I couldn't do it in > > FloatCanvas. > > You're right, there is no facility for that at the moment. I'm just put > a legend in a separate window, instead. But then if you save the image, > you don't get the legend. > > The key issue with making a legend is that all DrawObjects use "world" > coordinates, so a legend object would be in a given place in world > coordinates, where you would probably want it to stay in the same place > with respect to the Window, when zooming and panning. >
FloatCanvas uses "world" positions but you can always use Canvas.PixelToWorld() and Canvas.WorldToPixel() to translate between the two. This is actually all you need to be able to draw static labels/legends. (of course you need to redraw when panning/zooming, but that isn't an issue for me). Here is a link to one such image that draws the title at the top of the page using the pixeltoworld function, and the lat/lon labels around the edge of the image are positioned using a combination of world points and pixel to world points. http://jehiah.cz/images/RouteOfFlight20070601.png -- Jehiah _______________________________________________ FloatCanvas mailing list [email protected] http://mail.mithis.com/cgi-bin/mailman/listinfo/floatcanvas
