Forum Discussion

luojiandan_bi's avatar
5 years ago

how to package local images?

can I use local image in custom visual?I do like this:

but get error,because <iframe>/<sand-box>.

I‘m new developer of powerbi custom visual,can I use local image(finnaly package in visual) in custom visual?

@dm-p 

 

 

2 Replies

    • dm-p's avatar
      dm-p
      Super User

      Hi luojiandan_bi,

      I personally haven't tried it this way - it looks like Webpack will not recognise the variable assignment as a file and skip over it.

      When working with images, I tend to declare them as CSS classes I can use in the visual.less file, and these get encoded when the visual is packaged. They're much easier to work with in the DOM too this way, IMHO. Here's an example of how I do it for Deneb.

      If this approach doesn't work for you, I'd advise either creating an issue in the powerbi-visuals-tools Github project  or contacting the team at [email protected] for further details, as they don't monitor these forums and may be able to provided you with more targeted info.

      Good luck,

      Daniel