Skip to content

Conversation

@TheJoeFin
Copy link
Owner

Adding images to the center of QR Codes!

TheJoeFin and others added 27 commits October 6, 2025 17:50
Enhanced logo overlay precision by aligning dimensions and padding to QR code module boundaries. Updated SVG logo embedding for consistency and accuracy. Increased allowable logo size for error correction levels. Added null checks for clipboard operations to improve robustness. Refactored code for better readability and maintainability.
Introduced `logoPaddingPixels` parameter to control padding or cropping around logos in QR codes. Updated `BarcodeHelpers`, `BarcodeImageItem`, and `MainViewModel` to support this feature. Enhanced SVG and bitmap generation logic, added a UI slider for dynamic padding adjustment, and improved code consistency and rendering quality.
Refactored QR code logo embedding logic to use "punchout size" for better clarity and flexibility. Simplified calculations for punchout area, logo dimensions, and padding. Updated SVG embedding to reduce file size and align with new logic. Revised `MainPage.xaml` labels and tooltips to reflect updated terminology and functionality.
Updated `OverlayLogoOnQrCode` and `EmbedLogoInSvg` methods to accept a `backgroundColor` parameter, enabling customization of the punchout background color in both bitmap and SVG formats. Adjusted related logic and comments to reflect this enhancement.
- Adjusted QR code margin for tighter generation.
- Enhanced logo overlay logic with improved scaling and alignment.
- Refined padding and logo size calculations for better accuracy.
- Updated default logo settings for size and padding.
- Simplified error correction level handling with fixed values.
- Improved stream handling with explicit type usage.
- Enhanced UI with `SplitButton` for logo options and sliders.
- Consolidated bindings and improved code readability in XAML.
- Standardized formatting and improved code consistency.
- Fixed logo resizing issues and minor binding inconsistencies.
Refine the logic for setting the SizeTextVisible property to
also hide the size text when a logo image is present, in
addition to the existing HideMinimumSizeText condition.
Reduced the `Spacing` property of the `StackPanel` named `QrCodeOptions` from `12` to `6` to optimize spacing.
Decreased the `Width` of the "Code Color" and "Background Color" buttons from `68` to `48` to improve the visual design and save space in the user interface.
Add logo overlay to QR code center with adjustable size, file-based history persistence, and cross-page state preservation
The namespace declaration in `FaqItem.cs` was updated to remove an extraneous invisible character, ensuring proper formatting.

Added two new FAQ items to the `FaqItem` class:
1. "How does adding an image affect the QR Code?" - Explains the impact of adding a logo to the center of a QR Code and the importance of error correction levels.
2. "How is the center image stored in SVG files?" - Describes how center images are embedded in SVG files using Base64 encoding and notes that the image is stored as a raster (PNG).
@TheJoeFin TheJoeFin added enhancement New feature or request encoding Related to encoding text into different kinds of barcodes customize barcodes changing the appearance of generated barcodes labels Dec 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

customize barcodes changing the appearance of generated barcodes encoding Related to encoding text into different kinds of barcodes enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants