Hello There,
I need a help on getting the picture cropped from a particular lane.
I have a screen design which consists of Data,Layout and functions.I need the image only from the Layout section.Please share your thoughts about how can I get the image only from the Layout Lane.
I am getting the picture image from the Source model and not being able to crop it.
Thanks in advance!
Anindita
Hi Anindita,
this proposal only works if your Data and Layout lanes have the same size, because you can tile a model graphic only in same-sized image parts.
To get parts of a model graphic, you can use the following method on a model picture:
var modelPicture = model.Graphic(true, false, Context.getSelectedLanguage()) // returns a ModelPicture object (see help)
var arrPictureParts = modelPicture.getPictureTiled(tile_width, tile_height)
To determine the value for tile_width or tile_height you can acceess the model's lanes model.GetLanes( orientation ) and the lane's start (+end) coordinate: lane.Start() / lane.End(). If one of tile_height / tile_width should be entire model height / model width, you can use the constants Constants.MODEL_CANVAS_MAXHEIGHT / Constants.MODEL_CANVAS_MAXWIDTH.
Best regards,
Torsten