diff --git a/QRCoder/Assets/nuget-readme.md b/QRCoder/Assets/nuget-readme.md index ca7065eb..9b7e32de 100644 --- a/QRCoder/Assets/nuget-readme.md +++ b/QRCoder/Assets/nuget-readme.md @@ -19,10 +19,12 @@ The release notes for the current and all past releases can be read here: [📄 You only need a couple lines of code, to generate your first QR code. ```csharp -QRCodeGenerator qrGenerator = new QRCodeGenerator(); -QRCodeData qrCodeData = qrGenerator.CreateQrCode("The text which should be encoded.", QRCodeGenerator.ECCLevel.Q); -QRCode qrCode = new PngByteQRCode(qrCodeData); -byte[] qrCodeImage = qrCode.GetGraphic(20); +using (QRCodeGenerator qrGenerator = new QRCodeGenerator()) +using (QRCodeData qrCodeData = qrGenerator.CreateQrCode("The text which should be encoded.", QRCodeGenerator.ECCLevel.Q)) +using (PngByteQRCode qrCode = new PngByteQRCode(qrCodeData)) +{ + byte[] qrCodeImage = qrCode.GetGraphic(20); +} ``` There are a plenty of other options. So feel free to read more on that in our wiki: [Wiki: How to use QRCoder](https://github.com/codebude/QRCoder/wiki/How-to-use-QRCoder) diff --git a/readme.md b/readme.md index 24a68176..2c480049 100644 --- a/readme.md +++ b/readme.md @@ -43,10 +43,12 @@ _(More information on how to use Github Packages in Nuget Package Manager can be You only need a couple lines of code, to generate your first QR code. ```csharp -QRCodeGenerator qrGenerator = new QRCodeGenerator(); -QRCodeData qrCodeData = qrGenerator.CreateQrCode("The text which should be encoded.", QRCodeGenerator.ECCLevel.Q); -QRCode qrCode = new PngByteQRCode(qrCodeData); -byte[] qrCodeImage = qrCode.GetGraphic(20); +using (QRCodeGenerator qrGenerator = new QRCodeGenerator()) +using (QRCodeData qrCodeData = qrGenerator.CreateQrCode("The text which should be encoded.", QRCodeGenerator.ECCLevel.Q)) +using (PngByteQRCode qrCode = new PngByteQRCode(qrCodeData)) +{ + byte[] qrCodeImage = qrCode.GetGraphic(20); +} ``` There are a plenty of other options. So feel free to read more on that in our wiki: [Wiki: How to use QRCoder](https://github.com/codebude/QRCoder/wiki/How-to-use-QRCoder)