BarCodes with tall BarHeight gets "blurry" and not readable

WinForms

ComponentOne's WinForms controls

BarCodes with tall BarHeight gets "blurry" and not readable

  • rated by 0 users
  • This post has 1 Reply |
  • 0 Followers
  • We are having an issue with C1BarCode for .NET 2.0, v. 2.0.20083.26, when moving the ASP.NET application from a Windows 2003 x32 server with IIS 6, to a Windows 2008 x64 Server with IIS7.

    The exact same application seems to work on 2003 32-bits server, and is not working on 2008 server. Se results below. Is this a known bug ?

    When setting the BarHeight property to a value so that the length of the printed BarCode is like 50 - 60 cm long, the printed BarCode gets blurry and not readable. If setting the component to have a normal Barcode of 2 cm length, it is printed crisp and clear and fully readable. 

    We are putting the C1BarCode component on a literal in a webpage and "rendering"  using a routine like:

    if (bc.Image != null)
    {
         // create a bitmap the same size as the barcode image
         Rectangle rc = new Rectangle(Point.Empty, bc.Image.Size);
         Bitmap bmp = new Bitmap(rc.Width, rc.Height);
         // paint the bitmap background white
         using (Graphics g = Graphics.FromImage(bmp))
         {
              g.FillRectangle(
    Brushes.White, rc);
              g.DrawImage(bc.Image, rc);
         }
        
    // write the bitmap to the output stream in gif format
         Response.ContentType = "image/gif";
         bmp.Save(Response.OutputStream,
    ImageFormat.Gif);
         Response.Flush();
    }

    Regards,

    Swan B

     

  • The Graphics.DrawImage method will stretch the image to fill the destination rectangle. That process usually makes edges blurry, especially if you are stretching the image.

    I suggest you try the Graphics. DrawImageUnscaled method instead.

Page 1 of 1 (2 items)