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 b5fbd87 commit 7951feb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions DotNET/Sample_Source/Images/DrawToBitmap/DrawToBitmap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,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 @@ -270,6 +269,8 @@ static void DrawToGraphicsWithDrawParams(Page pg, DrawParams parms)
using (Bitmap bitmap = new Bitmap(width, height))
using (Graphics graphics = Graphics.FromImage(bitmap))
{
parms.CancelProc = new SampleCancelProc();
parms.ProgressProc = new SampleRenderProgressProc();
pg.DrawContents(graphics, parms);
SaveBitmap(bitmap, "Graphics");
}
Expand Down

0 comments on commit 7951feb

Please sign in to comment.