Exemplo n.º 1
0
 /// <summary>
 /// 绘制预览图
 /// </summary>
 private void DrawPreview(Graphics g)
 {
     if (background != null)
     {
         g.DrawImage(background, new RectangleF(0f, 0f, CmToPx(data.Width, dpiX), CmToPx(data.Height, dpiY)), new RectangleF(0, 0, background.Width, background.Height), GraphicsUnit.Pixel);
     }
     foreach (var i in data.ElementList)
     {
         var font = PrintController.CalcFont(Program.Config.Font, i.FontSize);
         g.DrawString(i.Value, font, Brushes.Black, new RectangleF(CmToPx(i.X, dpiX), CmToPx(i.Y, dpiY), CmToPx(i.Width, dpiX), CmToPx(i.Height, dpiY)));
     }
 }