teichgraf wrote:
Because a context will be created and disposed in DrawLine function refer to WriteableBitmapEx source code.
You would need to dispose the context. In WPF the bitmap is invalidated when its unlocked. In WBX the this is done in the dispose call. Use it like this:I don't think it's needed to manually create the context.wbmp = BitmapFactory.New(300, 300); IMG1.Source = wbmp; using(BitmapContext bmpc = wbmp.GetBitmapContext()) { // Clear the WriteableBitmap with white color wbmp.Clear(Colors.Red); wbmp.DrawLine(0, 0, 1000, 1000, Colors.Black); }
Because a context will be created and disposed in DrawLine function refer to WriteableBitmapEx source code.