Implemented for the next build: https://feedback.objo.dev/feature/562
Canvas now has two new properties:
Canvas1.Backdrop = Picture.FromAsset("UI/Map", Canvas1.ScaleFactor)
Canvas1.BackdropStretch = ImageStretch.UniformToFill
In the Window Designer, selecting a Canvas now shows:
- Backdrop: a dropdown listing the project’s image assets, plus
(None)
- BackdropStretch:
None, Fill, Uniform, or UniformToFill
The backdrop is drawn behind anything produced by the Canvas Paint event, so existing drawing code continues to work as before. The designer also previews the backdrop, layout XML stores it as backdropImageAsset, and generated code loads the image asset automatically at runtime.
If no backdrop is assigned, the render path only does a cheap null/size check and returns immediately. It does not fire extra Paint events or add VM-side drawing overhead.
Canvas.ToPicture() also includes the backdrop now, including the case where the canvas only has a backdrop and no paint commands.