public static void Run()
{
try
{
// ExStart:CreateImageWithExactBarcodeOnly
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_ManageBarCodes();
// Generate the barcode and set code text, symbology type
BarCodeBuilder builder = new BarCodeBuilder("123456", EncodeTypes.Code128);
// Get bitmap with exact barcode only and Save image on local disk
Bitmap bmp = builder.GetOnlyBarCodeImage();
bmp.Save(dataDir + "CreateImageWithExactBarcodeOnly_out.png", ImageFormat.Png);
// ExEnd:CreateImageWithExactBarcodeOnly
}
catch (Exception ex)
{
Console.WriteLine(ex.Message + "\nThis example will only work if you apply a valid Aspose License. You can purchase full license or get 30 day temporary license from http://www.aspose.com/purchase/default.aspx.");
}
}
}