JPG image file

10 posts, 1 answers
  1. Joseph
    Joseph avatar
    21 posts
    Member since:
    Mar 2013

    Posted 29 May 2013 Link to this post

    Hi guys,

     How can I generate a jpg image file from barcode?

    Thanks
    Joseph
  2. Answer
    Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 29 May 2013 Link to this post

    Hi,

    Please try the following C# code.

    C#:
    System.Drawing.Image image = RadBarCode1.GetImage();
    image.Save(filename, System.Drawing.Imaging.ImageFormat.Jpeg);

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Joseph
    Joseph avatar
    21 posts
    Member since:
    Mar 2013

    Posted 30 May 2013 Link to this post

    Got it. How can I specify the image size?
  5. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 30 May 2013 Link to this post

    Hi,

    The LineWidth (DotSize) set for the RadBarCode determines the return image size. Please check the following sample code.

    C#:
    barcode.LineWidth = 2;

    Thanks,
    Shinu.
  6. Joseph
    Joseph avatar
    21 posts
    Member since:
    Mar 2013

    Posted 30 May 2013 Link to this post

    Thanks for your reply Shinu.
    Then I tried to set the generated image as the data value for the radbinaryimage and I am getting a type conversion error.

    My C# code.
    System.Drawing.Image image = RadBarCode1.GetImage();
    image.Save(filename, System.Drawing.Imaging.ImageFormat.Jpeg);
    byte[] data;
    using (MemoryStream m = new MemoryStream())
        {
            data = new byte[m.Length];
            m.Write(data, 0, data.Length);
        }
    radbinaryimage1.DataValue=data;

    What am I doing wrong?
  7. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 30 May 2013 Link to this post

    Hi Joseph,

    Please try the following C# code.

    C#:
    System.IO.MemoryStream stream1 = new System.IO.MemoryStream();
    barcode1.GetImage().Save(stream1, System.Drawing.Imaging.ImageFormat.Jpeg);
    RadBinaryImage1.DataValue = stream1.ToArray();

    Thanks,
    Shinu.
  8. Joseph
    Joseph avatar
    21 posts
    Member since:
    Mar 2013

    Posted 05 Jun 2013 Link to this post

    Thanks, I have some confusion regarding the version. Which is the version that I should specify? Or telerik version?
  9. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 05 Jun 2013 Link to this post

    Hi Joseph,

    The Version property holds an integer value, in the range from 1 to 40, representing the version which one desires to use. Usually, higher-version QR codes are used do accommodate larger amounts of data.

    Thanks,
    Shinu.
  10. Sarah
    Sarah avatar
    2 posts
    Member since:
    May 2014

    Posted 21 May 2014 Link to this post

    In addition to barcode image size and QR Code version, I have a question related to barcode quiet zone? Is there any suggestion for this.
  11. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 21 May 2014 in reply to Sarah Link to this post

    Hi Sarah,

    EAN13 is a barcode symbology which encodes numbers into a series of bars. It is of fixed length, of 13 digit (12 data and 1 check), and accepts numbers. First digit is always placed outside the symbol; additionally a right quiet zone indicator (>) is used to indicate Quiet Zones that are necessary for barcode scanners to work properly. It includes a checksum. More information about RadBarcode properties could be found here and about different barcode types here.

    Thanks ,
    Princy.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017