You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm writing a program which renders images - think fractals or ray-tracing. Multiple background threads will update a buffer as the computation progresses, and I'd like the user to be able to see what is going on while this happens. Drawing the image takes multiple seconds in most cases, so I'd like this to be efficient but don't need 60fps responsiveness. I'm trying to understand the best way to do this in WinUI. I'd prefer to keep most of this in C#.
So far the options I am aware of:
Create a SoftwareBitmap, SoftwareBitmapSource, and BitmapBuffer. Background threads call LockBuffer then update chunks of the bitmap. In this case I am not sure how to signal that some part of the image should be redrawn on screen when it changes?
Or from the same article I could use a SwapChainPanel. That sounds a bit like overkill.
So my question is: given the constraints above, can you suggest how best to do this? Could be one of the above or something else entirely. Also, if you are aware of open source code or samples which demonstrate using that approach, pointers would be much appreciated.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi, I'm writing a program which renders images - think fractals or ray-tracing. Multiple background threads will update a buffer as the computation progresses, and I'd like the user to be able to see what is going on while this happens. Drawing the image takes multiple seconds in most cases, so I'd like this to be efficient but don't need 60fps responsiveness. I'm trying to understand the best way to do this in WinUI. I'd prefer to keep most of this in C#.
So far the options I am aware of:
So my question is: given the constraints above, can you suggest how best to do this? Could be one of the above or something else entirely. Also, if you are aware of open source code or samples which demonstrate using that approach, pointers would be much appreciated.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions