Posted 21 August 2019, 9:46 pm EST
Hi,
Could you please provide some sample code of how to save a barcode created with C1Barcode to an image file ?
Thanks in advance,
Stephan
Forums Home / ComponentOne / General Discussion
Posted by: grapecity on 21 August 2019, 9:46 pm EST
Posted 21 August 2019, 9:46 pm EST
Hi,
Could you please provide some sample code of how to save a barcode created with C1Barcode to an image file ?
Thanks in advance,
Stephan
Posted 22 August 2019, 4:40 pm EST
Hello,
You can use the Image property of C1BarCode which returns bitmap image of the control.
Code snippet is given below :
Image img = c1BarCode1.Image;
string filename = @"..\..\BarCode.bmp";
img.Save(filename);
The documentation link of the property is given below :
https://help.grapecity.com/componentone/NetHelp/c1barcode/webframe.html#C1.Win.BarCode.4~C1.Win.BarCode.C1BarCode~Image.html
Please go through the attached sample demonstrating the same.
I hope it helps.
Thanks and Regards,
Prabhat Sharma.
BarCodeToImage.zip
Posted 26 August 2019, 2:58 am EST
Hello,
Thanks very much for the info. As I am new to this, could you please provide a small sample of how to save a Datamatrix barcode 144x144 to an image of 300 dpi ?
Thanks in advance,
Stephan
Posted 26 August 2019, 4:13 pm EST
Hello,
Here is the sample attached to save the Datamatrix barcode to an image of 300dpi.
Please have a look.
If you need any other help, please let us know.
Regards,
Prabhat Sharma.
BarCodeToImage.zip
Posted 27 August 2019, 6:32 pm EST
Hello Prabhat,
Thanks for the sample and your support. It means a lot.
Regards,
Stephan