This sample shows how you can customize a picture, including the picture layout, the picture's border, and so on.
If you want to set an image to the picture or change the picture's image, use the src method to change the image. The picture's src can be a base64 image.
var originalWidth = picture.getOriginalWidth();
var originalHeight = picture.getOriginalHeight();
You can change the picture's layout using the pictureStretch method. Stretch for the picture is defined by the ImageLayout enumeration. Sometimes you can get the image's original size using getOriginalWidth and getOriginalHeight methods.
You can add a border to the picture; the border is set as the DOM's border setting. For example:
Sometimes part of the picture is transparent, in which case you want to set a backColor for the background area. Use the backColor method to get and set the background color of the picture. For example: