Hello,
I have a background pictures that gets loaded in a canvas at startup. On top of this picture I need to position some fields bearing the results of different calculations. These fields need to be precisely positioned in reference to some elements of the bg picture.
My problem is: how can I determine where to position the fields (i.e. their coordinates) in the window since I cannot see the bg picture until the app runs?
(I’m not sure I made myself clear)
Thank you
Instead of fields, could you just draw the text in the canvas paint event?
Open the picture in an image edit tool, and make notes of the co-ordinates.
At run time, be aware of the effects of scaling and potential aspect ratio distortion, depending upon how you are displaying the image.
1 Like
I’m not sure I understand. I think I still need to know where the text should go
I thought about it, I am not sure if the coordinates measured in an image editing app coincide with those in the Xojo Canvas (keeping in mind scaling etc.)
If its just a static image that you draw, you could drop that into your project then you can assign that image as the backdrop of the canvas under Appearance in the inspector and you will be able to see it at design time. Then set it back to None when you are done and ready to run.
2 Likes
Or set it to nil in the open event.