Skip to content

Instantly share code, notes, and snippets.

@aspose-com-kb
Last active September 10, 2021 09:59
using System;
//Use following namespaces to rotate barcode image
using Aspose.BarCode;
using Aspose.BarCode.Generation;
namespace RotateBarCodeImage
{
class Program
{
static void Main(string[] args)
{
//Set license before rotating barcode image
Aspose.BarCode.License AsposeBarCodeLicense = new Aspose.BarCode.License();
AsposeBarCodeLicense.SetLicense(@"c:\asposelicense\license.lic");
//initiate barcode generator object with Code128 encode type
BarcodeGenerator RotateBarCodeImage = new BarcodeGenerator(EncodeTypes.Code128);
RotateBarCodeImage.CodeText = "Product Code 123";
//set rotation of the barcode
RotateBarCodeImage.Parameters.RotationAngle = 45;
//save rotated barcode image as PNG
RotateBarCodeImage.Save("Rotated_BarCode_Image.png", BarCodeImageFormat.Png);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment