On 20/11/10 18:14, Ed Leafe wrote: > On Nov 20, 2010, at 1:27 PM, Iain Simpson wrote: > > >> Next problem - with my image database I can display images and their >> position but would like to show that position on a map. >> I can upload an appropriate map image (256px square .png ) and display >> it on a tabbed page. >> I can calculate the (x,y) offset on the map but is there any way I can >> add a marker (eg 4x4 px square) on top of a map image. >> > Yes, but you'll have to use absolute positioning (i.e., not sizers). > The pseudo-code would look something like this: > > map_img = dabo.ui.dImage(self, Size=(256, 256), Position=(0, 0), > Picture="map.png") > marker_img = dabo.ui.dImage(self, Size=(4, 4), Position=(123, 77), > Picture="marker.png") > # For good measure; may not be needed... > marker_img.bringToFront() >
Maybe I'm suggesting something stupid here but in that case it's a good chance to learn something. Couldn't he use the getPositionInSizer() method of the dImage's ControllingSizer() (or sizer() or ControllingSizerItem()? confused by so many options) to get the absolute position and from there calculate the absolute position of the marker image? That way with some little code in the dImage's Resize() event you could reposition the marker image. BTW, might he use dImage's Top and Left properties to get the position and forget about the sizer stuff? _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users Searchable Archives: http://leafe.com/archives/search/dabo-users This message: http://leafe.com/archives/byMID/[email protected]
