1. Add a hidden Data Label with unique name
This step is needed, so that your view instance can be easily found on a form. Finding a view by name is also ok, but then you must take care, that all your view instances have the same name on different forms.
2. Add a hidden picture control and select the image
When you add an image into the picture control, it is stored in a System SmartBox. This SmartBox is used by a handler to load the image from the Database on the form. Since all the images might have their own IDs on different environments, we need this step to make sure the image remains the same after the deployment.
If you know the ID of your image or you created a UI, where you select such images on the Admin form and initialize the view with the ImageID parameter or…, you can skip this step.
And here is an expression, which gets the Image ID from the hidden Picture control:
You can run the form and see the result of changing view background on K2 Smartforms: