本文整理汇总了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();
}
示例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);
}
}
示例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);
}
示例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();
}