Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 14, 2025

Summary

Fixed barcode alignment issue - all barcodes now align to the left edge of their container instead of being centered.

Changes Made

Modified 3 files with minimal, surgical changes:

1. RdlCri/ZxingBarcodes.cs

  • Changed barcode rendering to draw at position (0,0) instead of replacing bitmap
  • Use FillRectangle instead of Graphics.Clear for cross-platform compatibility
  • Affects: QrCode, BarCode128, BarCode39, BarCodeEAN8, AztecCode, DataMatrix, Pdf417Barcode

2. RdlCri/BarCodeITF14.cs

  • Draw barcode at position (0,0) instead of replacing bitmap
  • Use FillRectangle instead of Graphics.Clear for cross-platform compatibility
  • Affects: BarCodeITF14

3. RdlCri/BarCodeEAN13.cs

  • Removed left quiet zone offset to start drawing from position 0
  • Adjusted text positioning accordingly
  • Affects: BarCodeEAN13, BarCodeBookland

Technical Details

  • Lines changed: 26 insertions, 12 deletions (14 net)
  • Build status: ✅ Successful (0 errors, 0 new warnings)
  • Backward compatibility: This changes visual layout - barcodes will appear left-aligned instead of centered

Visual Change

Before: Barcode centered in container with padding on both sides
After: Barcode starts at left edge (0,0) with padding only on right side

Testing Notes

  • Build successful with no compilation errors
  • Used FillRectangle instead of Graphics.Clear for cross-platform compatibility
  • Manual testing on Windows recommended to verify visual alignment
  • Barcode readability and scanning should be unaffected (only position changed, not encoding)
Original prompt

This section details on the original issue you should resolve

<issue_title>barcode align left</issue_title>
<issue_description>can any one help me to align barcode to the left, now it always align to center</issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #204


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: majorsilence <656288+majorsilence@users.noreply.github.com>
Copilot AI changed the title [WIP] Align barcode to the left instead of center Align barcodes to the left instead of center Oct 14, 2025
Copilot AI requested a review from majorsilence October 14, 2025 15:55
Copy link
Owner

@majorsilence majorsilence left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot review the check failure messages and fix the problems

'Graphics' does not contain a definition for 'Clear' and no accessible extension method 'Clear' accepting a first argument of type 'Graphics' could be found (are you missing a using directive or an assembly reference?)

…patibility

Co-authored-by: majorsilence <656288+majorsilence@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Oct 18, 2025

@copilot review the check failure messages and fix the problems

'Graphics' does not contain a definition for 'Clear' and no accessible extension method 'Clear' accepting a first argument of type 'G...

Fixed in commit f3a1c92. Replaced Graphics.Clear() with FillRectangle() in both ZxingBarcodes.cs and BarCodeITF14.cs for cross-platform compatibility. Build now succeeds with 0 errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

barcode align left

2 participants