From 5287a7a80d82e7ab5f42860b9e62552b16f6d08d Mon Sep 17 00:00:00 2001 From: bruceh Date: Fri, 9 Sep 2022 18:13:19 -0500 Subject: [PATCH] Remove common SampleCancelProc and SampleRenderProgressProc Re-using these callbacks caused issues on ARM Linux. Cancel callback appeared to be getting called twice. Making new one for each Draw function call has alleviated this issue. --- .../Sample_Source/Images/DrawToBitmap/DrawToBitmap.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/DotNETCore/Sample_Source/Images/DrawToBitmap/DrawToBitmap.cs b/DotNETCore/Sample_Source/Images/DrawToBitmap/DrawToBitmap.cs index c48c0757..3c5fb353 100644 --- a/DotNETCore/Sample_Source/Images/DrawToBitmap/DrawToBitmap.cs +++ b/DotNETCore/Sample_Source/Images/DrawToBitmap/DrawToBitmap.cs @@ -89,9 +89,6 @@ private static DrawParams ConstructDrawParams(Matrix matrix, Rect updateRect, bo parms.EnableBlackPointCompensation = blackPointCompensation; - parms.CancelProc = new SampleCancelProc(); - parms.ProgressProc = new SampleRenderProgressProc(); - return parms; } @@ -226,6 +223,8 @@ static void DrawToBitmapWithDrawParams(Page pg, DrawParams parms) using (Bitmap bitmap = new Bitmap(width, height)) { + parms.CancelProc = new SampleCancelProc(); + parms.ProgressProc = new SampleRenderProgressProc(); pg.DrawContents(bitmap, parms); SaveBitmap(bitmap, "Bitmap"); } @@ -269,6 +268,8 @@ static void DrawToGraphicsWithDrawParams(Page pg, DrawParams parms) using (Bitmap bitmap = new Bitmap(width, height)) { + parms.CancelProc = new SampleCancelProc(); + parms.ProgressProc = new SampleRenderProgressProc(); pg.DrawContents(bitmap, parms); SaveBitmap(bitmap, "Graphics"); }