c# - Updating bitmapSource - copying one to another -
This is my exception
calling thread can not access this object because a different This is the owner of the thread My function is the result of a calculation and I already want to update an open window ..
public override void UpdateResult (BaseMetricResults Results ) {Var newResults = As a result of metric reagent results; If (newResults == zero) {return; } DispatcherHelper.UIDispatcher.Invoke (() = & gt; {TopToBottomGraph.CrossSectionPoints.Clear (); foreach (Multiple point in new properties. TopToBottomGraph.CrossSectionPoints) {TopToBottomGraph.CrossSectionPoints.Add (point);} newResults.JetMap.Freeze (); // here [] arr = new byte byte exception [(int) (newResults.JetMap.Width * newResults.JetMap.Height * 3)]; newResults.JetMap.CopyPixels (Arrival, (int) (newResults.JetMap .Width * 3), 0); JetMap = BitmapSource.Create ((int) newResults.JetMap.Width, (int) newResults.JetMap.Height, 96, 96, PixelFormats.Rgb24, BitmapPalettes.WebPalette, Arrival, (int) (NewResults .JetMap.Width * 3));}); } This is my last attempt I am not sure if I need to freeze bitmapsource or not ...
Anyway newResults.JetMap is BitmapSource, and I have a property The JetMap is a new bitmapsource, how can I update the old image with a new image?
You need to make it after you are correct and, the dispatcher is not inside one once in their frozen you can set it inside the dispatcher and you will not get an exception
Comments
Post a Comment