How to Resize a QR Code Image
Proper scaling keeps QR codes scannable across print and digital formats. Accurate dimensions prevent blurring and ensure clear readability.
In this how-to guide, we will explore how the resizing of a QR code is performed using IronQR.
How to Resize a QR Code Image
- Download the IronQR C# library to resize QR codes
- Create a
QrStyleOptionsobject - Set the
Dimensionsproperty for the required size - Generate the QR code
- Save the resized QR code
Resizing QR Code
To create a custom-sized QR code for print or signage, set the Dimensions property to a specific value, then save the generated QR code with the QrStyleOptions applied.
In the example, we create a QR code from a URL, apply a custom size of 500 pixels using the Dimensions property of the QrStyleOptions class, and save the resized QR code as a PNG.
Dimensions property provides a direct 1:1 mapping; the integer you define becomes the exact pixel width and height of the final output.:path=/static-assets/qr/content-code-examples/how-to/resize-qr-code.csusing IronQr;
using IronSoftware.Drawing;
string url = "https://ironsoftware.com/csharp/qr/";
// Generate the QR code data
QrCode qr = QrWriter.Write(url);
// Save using default dimensions
AnyBitmap qrDefault = qr.Save();
qrDefault.SaveAs("qr-default-size.png");
// Define custom resizing
QrStyleOptions styleOptions = new QrStyleOptions
{
Dimensions = 500
};
// Save using the style options
AnyBitmap qrResized = qr.Save(styleOptions);
qrResized.SaveAs("qr-resized.png");Original

Resized







