Hi
I have below code & i want to save it in d Drive
Bitmap qrCodeImage = GenerateQRCode(qrData);
qrCodeImage.Save("QRCode.png", System.Drawing.Imaging.ImageFormat.Png);
Thanks
Hi
I have below code & i want to save it in d Drive
Bitmap qrCodeImage = GenerateQRCode(qrData);
qrCodeImage.Save("QRCode.png", System.Drawing.Imaging.ImageFormat.Png);
Thanks
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Alpesh ManiyaPosted Jan 25, 2024, 6:55 AM
If you want to save the generated
qrCodeImageto the D drive, you can specify the complete path in theSavemethod. Here's an example:In this example,
Path.Combineis used to create the complete file path by combining the directory ("D:\") and the file name ("QRCode.png"). This ensures that the code is platform-independent and works correctly on different operating systems.Jithu ThomasPosted Jan 25, 2024, 9:41 AM
using System.Drawing;
// Assuming GenerateQRCode() is a method that returns a Bitmap
// Generate QR code
Bitmap qrCodeImage = GenerateQRCode(qrData);
// Specify the full path on the D drive
string filePath = @"D:\QRCode.png";
// Save the QR code image to the specified path
qrCodeImage.Save(filePath, System.Drawing.Imaging.ImageFormat.Png);