当前位置: 首页>>代码示例>>C#>>正文


C# RectangleF.GetPaddedRectangleMm方法代码示例

本文整理汇总了C#中System.Drawing.RectangleF.GetPaddedRectangleMm方法的典型用法代码示例。如果您正苦于以下问题:C# RectangleF.GetPaddedRectangleMm方法的具体用法?C# RectangleF.GetPaddedRectangleMm怎么用?C# RectangleF.GetPaddedRectangleMm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Drawing.RectangleF的用法示例。


在下文中一共展示了RectangleF.GetPaddedRectangleMm方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PrintCabecalho

        /// <summary>
        /// Imprime o cabeçalho do bloco.
        /// </summary>
        private void PrintCabecalho(PrimitiveComposer comp)
        {
            BlockComposer bComp = new BlockComposer(comp);

            RectangleF rect = new RectangleF(0, 0, Size.Width, Danfe.CabecalhoBlocoAltura);
            rect = rect.GetPaddedRectangleMm(0, 0, 1, 0.3F);

            comp.SetFont(Danfe.FontBold, 5);
            bComp.SafeBegin(rect, XAlignmentEnum.Left, YAlignmentEnum.Bottom);
            bComp.ShowText(Cabecalho.ToUpper());
            bComp.End();

            comp.Flush();
        }
开发者ID:josuecorrea,项目名称:DanfeSharp,代码行数:17,代码来源:BlocoDanfe.cs

示例2: PrintIdentificacaoEmitente

        private void PrintIdentificacaoEmitente(RectangleF area, BlockComposer bComp, PrimitiveComposer comp)
        {
            comp.SafeDrawRectangle(area);

            // Retângulo com padding
            RectangleF pRet = area.GetPaddedRectangleMm(1);

            var emitente = Danfe.Model.Emitente;

            var yAlign = Danfe.PossuiLogo ? YAlignmentEnum.Bottom : YAlignmentEnum.Middle;

            bComp.SafeBegin(pRet, XAlignmentEnum.Left, yAlign);

            double bestSize = DanfeCampo.AjustarFonte(emitente.Nome, Danfe.FontBold, pRet.Width, Danfe.PossuiLogo ? 10 : 12);
            comp.SetFont(Danfe.FontBold, bestSize);

            bComp.ShowText(emitente.Nome);
            bComp.ShowBreak();
            comp.SetFont(Danfe.Font, Danfe.PossuiLogo ? 7 : 8);
            bComp.ShowText(emitente.EnderecoLinha1);
            bComp.ShowBreak();
            bComp.ShowText(emitente.EnderecoBairro);
            bComp.ShowBreak();
            bComp.ShowText(emitente.EnderecoLinha3);

            if (!String.IsNullOrWhiteSpace(emitente.Telefone))
            {
                bComp.ShowBreak();
                bComp.ShowText(String.Format("Fone: {0}", Formatador.FormatarTelefone(emitente.Telefone)));
            }

            bComp.End();

            if (Danfe.PossuiLogo)
            {
                RectangleF logoRectangle = area;
                logoRectangle.Height = bComp.BoundBox.Top - logoRectangle.Y;
                PrintLogo(comp, logoRectangle);
            }
        }
开发者ID:josuecorrea,项目名称:DanfeSharp,代码行数:40,代码来源:BlocoDadosNFe.cs

示例3: PrintLogo

        private void PrintLogo(PrimitiveComposer comp, RectangleF area)
        {
            area = area.GetPaddedRectangleMm(1.5F, 1.5F, 1.5F, 1F);

            SizeF bestsize = BestFitSize(Danfe._Logo.Size, area.Size);
            PointF point = PointF.Empty;
            point.X = area.X + Math.Abs(area.Width - bestsize.Width) / 2F;
            point.Y = area.Y + Math.Abs(area.Height - bestsize.Height) / 2F;

            comp.ShowXObject(Danfe._Logo, point, bestsize);
        }
开发者ID:josuecorrea,项目名称:DanfeSharp,代码行数:11,代码来源:BlocoDadosNFe.cs

示例4: PrintDescricaoDanfe

        private void PrintDescricaoDanfe(RectangleF area, BlockComposer bComp, PrimitiveComposer comp)
        {
            comp.SafeDrawRectangle(area);

            // Retangulo com padding
            RectangleF pRet = area.GetPaddedRectangleMm(1);

            // DANFE e descrição
            bComp.SafeBegin(pRet, XAlignmentEnum.Center, YAlignmentEnum.Top);
            comp.SetFont(Danfe.FontBold, 12);
            bComp.ShowText("DANFE");
            comp.SetFont(Danfe.Font, 6);
            bComp.ShowBreak(new SizeF(0, 1));
            bComp.ShowText(DescricaoDanfe);
            bComp.End();

            // Entrada, Saída
            RectangleF rEntrasaSaida = new RectangleF(pRet.X, bComp.BoundBox.Bottom + Utils.Mm2Pu(1.5F), pRet.Width, pRet.Bottom - bComp.BoundBox.Bottom);
            rEntrasaSaida = rEntrasaSaida.GetPaddedRectangleMm(0, 2.5F);

            comp.SetFont(Danfe.Font, 8);
            bComp.SafeBegin(rEntrasaSaida, XAlignmentEnum.Left, YAlignmentEnum.Top);
            bComp.ShowText("0 - Entrada\n1 - Saída");
            bComp.End();

            RectangleF rEntrasaSaida2 = bComp.BoundBox;
            rEntrasaSaida2 = new RectangleF(rEntrasaSaida.Right - bComp.BoundBox.Height, bComp.BoundBox.Y, bComp.BoundBox.Height, bComp.BoundBox.Height);
            comp.SafeDrawRectangle(rEntrasaSaida2);

            bComp.SafeBegin(rEntrasaSaida2, XAlignmentEnum.Center, YAlignmentEnum.Middle);
            bComp.ShowText(Danfe.Model.TipoNF.ToString());
            bComp.End();

            // Número Série e Folha
            RectangleF retEsquerdo = pRet;
            retEsquerdo.Width = Utils.Mm2Pu(8);

            RectangleF retDireito = pRet;
            retDireito.X = retEsquerdo.Right + Utils.Mm2Pu(1);
            retDireito.Width = pRet.Right - retDireito.Left;

            RetanguloFolha = retDireito;
            retDireito.Height -= (float)Danfe.FontBold.GetLineHeight(TamanhoFonteNumeracao);

            comp.SetFont(Danfe.FontBold, TamanhoFonteNumeracao);
            bComp.SafeBegin(retEsquerdo, XAlignmentEnum.Right, YAlignmentEnum.Bottom);
            bComp.ShowText("Nº\nSérie\nFolha");
            bComp.End();

            bComp.SafeBegin(retDireito, XAlignmentEnum.Left, YAlignmentEnum.Bottom);
            bComp.ShowText(String.Format("{0}\n{1}", Danfe.Model.NumeroNF.ToString(Formatador.FormatoNumeroNF), Danfe.Model.Serie));
            bComp.End();
        }
开发者ID:josuecorrea,项目名称:DanfeSharp,代码行数:53,代码来源:BlocoDadosNFe.cs


注:本文中的System.Drawing.RectangleF.GetPaddedRectangleMm方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。