Free Support Forum -

Barcode becomes Unusable After Rotation

We re upgrading from V5.5 to V18.7. Under V5.5, rotation used to work perfectly well. Now, rotated barcodes are unusable (meaning they cannot be scanned) because there is too much grey colour between the black bars.

Here is the code (I can attach sample resulting files if needed):

        using (BarCodeBuilder bcp = new BarCodeBuilder())
            bcp.EncodeType = Aspose.BarCode.Generation.EncodeTypes.Code128;
            bcp.CodeText = barcode;
            bcp.Margins.Top = 1f;
            bcp.Margins.Left = 0f;
            bcp.Margins.Right = 0f;
            bcp.Margins.Bottom = 1f;
            bcp.RotationAngleF = 90;
            bcp.ImageQuality = ImageQualityMode.Default;
            bcp.BarHeight = 17.5f;//12.5f;
            bcp.xDimension = 0.2f;
            bcp.CodeLocation = CodeLocation.None;

            System.IO.MemoryStream mStream = new System.IO.MemoryStream();
            bcp.BarCodeImage.Save(mStream, System.Drawing.Imaging.ImageFormat.Png);
            buffer = mStream.ToArray();

        File.WriteAllBytes(@"c:\temp\\asposeBarcodeTestXDimension0_2_V18_7.gif", buffer);
        return buffer;


Can you please further elaborate the issue? If you want to read, rotated images, you can use Orientation Hints and Recognition Hints to further enhance the recognition process for such images.

Please also share sample images with more details if the issue persists or if your requirement is different.