Skip to content

Commit

Permalink
Merge pull request #474 from koaqiu/master
Browse files Browse the repository at this point in the history
fix:修正在绘制自定义finderPatternImage时,同时绘制QuietZones会出现位置异常的BUG
  • Loading branch information
codebude authored Apr 22, 2024
2 parents 92e3910 + c4e0e9d commit db84288
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions QRCoder/ArtQRCode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,10 @@ public Bitmap GetGraphic(int pixelsPerModule, Color darkColor, Color lightColor,
if (finderPatternImage != null)
{
var finderPatternSize = 7 * pixelsPerModule;
graphics.DrawImage(finderPatternImage, new Rectangle(0, 0, finderPatternSize, finderPatternSize));
graphics.DrawImage(finderPatternImage, new Rectangle(size - finderPatternSize, 0, finderPatternSize, finderPatternSize));
graphics.DrawImage(finderPatternImage, new Rectangle(0, size - finderPatternSize, finderPatternSize, finderPatternSize));
var finderPatternOffset = drawQuietZones ? 4 * pixelsPerModule : 0;
graphics.DrawImage(finderPatternImage, new Rectangle(finderPatternOffset, finderPatternOffset, finderPatternSize, finderPatternSize));
graphics.DrawImage(finderPatternImage, new Rectangle(size - finderPatternOffset - finderPatternSize, finderPatternOffset, finderPatternSize, finderPatternSize));
graphics.DrawImage(finderPatternImage, new Rectangle(finderPatternOffset, size - finderPatternOffset - finderPatternSize, finderPatternSize, finderPatternSize));
}
graphics.Save();
}
Expand Down

0 comments on commit db84288

Please sign in to comment.