Exemplo n.º 1
0
        float GetMagnification(Graphics g, int width, int height)
        {
            float r = (float)height / (float)width;

            if (r <= BarCodeEAN13.AspectRatio)
            {   // height is the limiting value
                r = BarCodeEAN13.MmYFromPixel(g, height) / BarCodeEAN13.OptimalHeight;
            }
            else
            {   // width is the limiting value
                r = BarCodeEAN13.MmXFromPixel(g, width) / BarCodeEAN13.OptimalWidth;
            }
            // Set the magnification limits
            //    Specification says 80% to 200% magnification allowed
            if (r < .8f)
            {
                r = .8f;
            }
            else if (r > 2f)
            {
                r = 2;
            }

            return(r);
        }
        BarCodeEAN13 _Ean13;        // the EAN-13 barcode object

        public BarCodeBookland()    // Need to be able to create an instance
        {
            _Ean13 = new BarCodeEAN13();
        }
Exemplo n.º 3
0
 internal BarCodeProperties(BarCodeEAN13 bc, XmlNode node)
 {
     _bc   = bc;
     _node = node;
 }