Skip to content

Commit

Permalink
Remove common SampleCancelProc and SampleRenderProgressProc
Browse files Browse the repository at this point in the history
    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.
  • Loading branch information
datalogics-bruceh committed Sep 9, 2022
1 parent 212e4c6 commit 5287a7a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions DotNETCore/Sample_Source/Images/DrawToBitmap/DrawToBitmap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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");
}
Expand Down Expand Up @@ -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");
}
Expand Down

0 comments on commit 5287a7a

Please sign in to comment.