<?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 Re: Is there a known time for which it is safe to reuse the buffer passed to PictureMarkerSymbol.SetSource? in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/is-there-a-known-time-for-which-it-is-safe-to/m-p/579265#M7068</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you able to write to the buffer once the call to SetSourceAsync completes?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 02 May 2016 17:11:40 GMT</pubDate>
    <dc:creator>MichaelBranscomb</dc:creator>
    <dc:date>2016-05-02T17:11:40Z</dc:date>
    <item>
      <title>Is there a known time for which it is safe to reuse the buffer passed to PictureMarkerSymbol.SetSource?</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/is-there-a-known-time-for-which-it-is-safe-to/m-p/579264#M7067</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/net/desktop/api-reference//html/M_Esri_ArcGISRuntime_Symbology_PictureMarkerSymbol_SetSource.htm" title="https://developers.arcgis.com/net/desktop/api-reference//html/M_Esri_ArcGISRuntime_Symbology_PictureMarkerSymbol_SetSource.htm"&gt;PictureMarkerSymbol.SetSource Method&lt;/A&gt; &lt;/P&gt;&lt;P&gt;If it is possible, I would like to reuse the buffer. However, without knowing when the runtime is "done" reading from it, I don't know when it is safe. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I already verified that the buffer is not read from right away by writing to it immediately after setting it. Also, I saw that SetSource executes superfast (microseconds on my machine) lending further evidence that it is probably not doing any decoding right away.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why do I want to reuse the buffer? I want to create less garbage (and hence GC pressure). I am attempting to use the PictureMarkerSymbol as a way to include general raster content generated on the fly. I am writing my own renderer that draws to a bitmap, encodes it, and then sends it to the runtime. Yes, this is very awkward, but the other runtime APIs do not satisfy my use case. See &lt;A href="https://community.esri.com/thread/174369"&gt;draw a million or more small lines. data set updated at 1-10Hz&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Apr 2016 12:38:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/is-there-a-known-time-for-which-it-is-safe-to/m-p/579264#M7067</guid>
      <dc:creator>carloscasanova</dc:creator>
      <dc:date>2016-04-29T12:38:56Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a known time for which it is safe to reuse the buffer passed to PictureMarkerSymbol.SetSource?</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/is-there-a-known-time-for-which-it-is-safe-to/m-p/579265#M7068</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you able to write to the buffer once the call to SetSourceAsync completes?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 May 2016 17:11:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/is-there-a-known-time-for-which-it-is-safe-to/m-p/579265#M7068</guid>
      <dc:creator>MichaelBranscomb</dc:creator>
      <dc:date>2016-05-02T17:11:40Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a known time for which it is safe to reuse the buffer passed to PictureMarkerSymbol.SetSource?</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/is-there-a-known-time-for-which-it-is-safe-to/m-p/579266#M7069</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mike, that did the trick. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After "awaiting", I can party on the buffer with no ill consequence.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is some more context in case others run into my problem:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was using a MemoryStream. I could only get it to work with SetSource and not with SetSourceAsync because I &lt;STRONG&gt;forgot to set the seek point on the stream to the beginning before passing it to SetSourceAsync&lt;/STRONG&gt;. From my testing, the operation is async with both SetSource and SetSourceAsync. SetSourceAsync just allows to monitor when that async operation completes. Because the operation is async, I noticed an occasional error when I would write to the stream right away after passing it to SetSource because I was writing data that the runtime was reading at the same time.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 May 2016 18:05:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/is-there-a-known-time-for-which-it-is-safe-to/m-p/579266#M7069</guid>
      <dc:creator>carloscasanova</dc:creator>
      <dc:date>2016-05-02T18:05:36Z</dc:date>
    </item>
  </channel>
</rss>

