Background image for a shape

Hi All,
I want to fill a shape with a background image. The requirement is some thing like this, I want to model organizations , as rectangles in my modeller. To easily identify them, I want to set as background image the logo of the company…
In svg I suppose we need to define a pattern that contains an image and use that to fill the shape…How can I achieve this in the renderer, to create a pattern that is not part of the shape svg?

Thanks and Regards
Rajender

I want to achieve this too…

in v16, we can use image function in custom render, but this function seems to be removed in latest version v18

Take a look at how we render the nyan cat in the bpmn-js-nyan project.

In the latest version of bpmn-js we got rid of snap-svg and are now using native SVG (with the help of our own tiny-svg library) to render the graphics. Find out how to do it with the native browser SVG and it should be straightforward to adapt it.

Cheers,
Ricardo Matias

you can still create image, use svgCreate(‘image’);