AnsweredAssumed Answered

Is there a known time for which it is safe to reuse the buffer passed to PictureMarkerSymbol.SetSource?

Question asked by ccasanova on Apr 29, 2016
Latest reply on May 2, 2016 by ccasanova

PictureMarkerSymbol.SetSource Method

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.


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.


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 draw a million or more small lines. data set updated at 1-10Hz