Esempio n. 1
0
        /// <summary>
        /// Renderiza um boleto por meio de um ponteiro Graphics
        /// </summary>
        public void Render(Graphics g)
        {
            if (RenderBoleto == null)
            {
                RenderBoleto = new BoletoNormal();
            }

            if (RenderBoleto.Count == -1)
            {
                RenderBoleto.MakeFields(this);
            }

            RenderBoleto.Render(g, Escala);
        }
Esempio n. 2
0
        /// <summary>
        /// Calculao código de Barras e a linha digitável (IPTE)
        /// </summary>
        public void CalculaBoleto()
        {
            CalcCodBar();
            LinDigitavel = CobUtil.CalcLinDigitavel(this.CodBarras);

            if (RenderBoleto == null)
            {
                RenderBoleto = new BoletoNormal();
            }

            if (RenderBoleto.Count == -1)
            {
                RenderBoleto.MakeFields(this);
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Cria a imagem do tamanho correto ( Adicionado novos recursos por Alexandre Savelli Bencz )
        /// </summary>
        public Bitmap NewImage()
        {
            if (LinhaDigitavel == "")
            {
                CalculaBoleto();
            }

            if (RenderBoleto == null)
            {
                RenderBoleto = new BoletoNormal();
            }

            if (RenderBoleto.Count == -1)
            {
                RenderBoleto.MakeFields(this);
            }

            int w = (int)(Escala * RenderBoleto.Width);  // Retorna em pixels
            int h = (int)(Escala * RenderBoleto.Height); // Retorna em pixels

            return(new Bitmap(w, h));
        }