<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Image leaves behind artifacts when resized in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Image-leaves-behind-artifacts-when-resized/m-p/216554#M6826</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have finally succeeded in creating a working custom visual.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have also successfully added an image to the visual:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;let image = this.svg.append("svg:image")
        .attr('x', 15)
        .attr('y', -10)
        .attr('width', width * 0.2)
        .attr('height', height * 0.2)
        .attr("xlink:href", logo) //logo is a path&lt;/PRE&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;However, resizing this image with transparent background leaves behind artifacts, like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ImageArtifact.PNG" style="width: 284px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/51207i07685A5DC3443EF0/image-size/large?v=v2&amp;amp;px=999" role="button" title="ImageArtifact.PNG" alt="ImageArtifact.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Using a picture with a white background works better, but it doesn't really fix the problem as resizing the picture quickly leaves the same trail. I can "draw" with the picture, so if I rezize the visual slowly enough I can hide the artifacts. That is not my goal though, as those artifacts shouldn't be there in the first place.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I fix that?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;EDIT: I just noticed, that it doesn't leave behind artifacts if the visual is resized with the "latches" on the top or left side. Those only stay there if the middle right, bottom right, and bottom middle ones are used. Is the problem somehow with points the image is attached to?&lt;/P&gt;</description>
    <pubDate>Fri, 21 Jul 2017 12:00:59 GMT</pubDate>
    <dc:creator>ConnectedRoman</dc:creator>
    <dc:date>2017-07-21T12:00:59Z</dc:date>
    <item>
      <title>Image leaves behind artifacts when resized</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Image-leaves-behind-artifacts-when-resized/m-p/216554#M6826</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have finally succeeded in creating a working custom visual.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have also successfully added an image to the visual:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;let image = this.svg.append("svg:image")
        .attr('x', 15)
        .attr('y', -10)
        .attr('width', width * 0.2)
        .attr('height', height * 0.2)
        .attr("xlink:href", logo) //logo is a path&lt;/PRE&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;However, resizing this image with transparent background leaves behind artifacts, like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ImageArtifact.PNG" style="width: 284px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/51207i07685A5DC3443EF0/image-size/large?v=v2&amp;amp;px=999" role="button" title="ImageArtifact.PNG" alt="ImageArtifact.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Using a picture with a white background works better, but it doesn't really fix the problem as resizing the picture quickly leaves the same trail. I can "draw" with the picture, so if I rezize the visual slowly enough I can hide the artifacts. That is not my goal though, as those artifacts shouldn't be there in the first place.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I fix that?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;EDIT: I just noticed, that it doesn't leave behind artifacts if the visual is resized with the "latches" on the top or left side. Those only stay there if the middle right, bottom right, and bottom middle ones are used. Is the problem somehow with points the image is attached to?&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jul 2017 12:00:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Image-leaves-behind-artifacts-when-resized/m-p/216554#M6826</guid>
      <dc:creator>ConnectedRoman</dc:creator>
      <dc:date>2017-07-21T12:00:59Z</dc:date>
    </item>
    <item>
      <title>Re: Image leaves behind artifacts when resized</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Image-leaves-behind-artifacts-when-resized/m-p/217495#M6849</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/35915"&gt;@ConnectedRoman&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Every time&amp;nbsp;the custom visual is resized, it will call update method. So in your case, more and more new images are appended.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jul 2017 09:21:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Image-leaves-behind-artifacts-when-resized/m-p/217495#M6849</guid>
      <dc:creator>v-chuncz-msft</dc:creator>
      <dc:date>2017-07-24T09:21:40Z</dc:date>
    </item>
    <item>
      <title>Re: Image leaves behind artifacts when resized</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Image-leaves-behind-artifacts-when-resized/m-p/217546#M6851</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/11389"&gt;@v-chuncz-msft&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your answer - that's what I thought.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How should I got about fixing it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Adding a&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;d3.selectAll('svg:image').remove();&lt;/PRE&gt;&lt;P&gt;before the code where I add the picture only accomplishes that the image doesn't even show up in the visual. I also tried initializing image in the class scope but the image still doesn't show up that way.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jul 2017 10:15:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Image-leaves-behind-artifacts-when-resized/m-p/217546#M6851</guid>
      <dc:creator>ConnectedRoman</dc:creator>
      <dc:date>2017-07-24T10:15:18Z</dc:date>
    </item>
    <item>
      <title>Re: Image leaves behind artifacts when resized</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Image-leaves-behind-artifacts-when-resized/m-p/218211#M6863</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/35915"&gt;@ConnectedRoman&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That's because 'svg:image' is not a valid selector.&lt;/P&gt;
&lt;PRE&gt;d3.selectAll('svg &amp;gt; image').remove();&lt;/PRE&gt;</description>
      <pubDate>Tue, 25 Jul 2017 05:32:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Image-leaves-behind-artifacts-when-resized/m-p/218211#M6863</guid>
      <dc:creator>v-chuncz-msft</dc:creator>
      <dc:date>2017-07-25T05:32:11Z</dc:date>
    </item>
    <item>
      <title>Re: Image leaves behind artifacts when resized</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Image-leaves-behind-artifacts-when-resized/m-p/218592#M6877</link>
      <description>&lt;P&gt;That worked, thank you for bearing with my noobines.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2017 13:16:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Image-leaves-behind-artifacts-when-resized/m-p/218592#M6877</guid>
      <dc:creator>ConnectedRoman</dc:creator>
      <dc:date>2017-07-25T13:16:46Z</dc:date>
    </item>
  </channel>
</rss>

