win10怎么查看激活到期时间如何看是否永久激活

转载自百度:https://jingyan.baidu.com/article/7f766daf8063c64101e1d0eb.html
C# 打印图片 https://social.msdn.microsoft.com/Forums/zh-CN/01d6c514-a3a2-4383-a35d-832be181ded8/c-25171213602227029255?forum=2212

C#实现打印源码如下:
#region 打印

private void btnPrint_Click(object sender, EventArgs e)

{

//打印预览

//PrintPreviewDialog ppd = new PrintPreviewDialog();

PrintDocument pd = new PrintDocument();

//设置边距

Margins margin = new Margins(20, 20, 20, 20);

pd.DefaultPageSettings.Margins = margin;

纸张设置默认

//PaperSize pageSize = new PaperSize(“First custom size”, 800, 600);

//pd.DefaultPageSettings.PaperSize = pageSize;

//打印事件设置

pd.PrintPage += new PrintPageEventHandler(this.pd_PrintPage);

//ppd.Document = pd;

//ppd.ShowDialog();

try

{

pd.Print();

}

catch (Exception ex)

{

MessageBox.Show(ex.Message, “打印出错”, MessageBoxButtons.OK, MessageBoxIcon.Error);

pd.PrintController.OnEndPrint(pd, new PrintEventArgs());

}

}

//打印事件处理

private void pd_PrintPage(object sender, PrintPageEventArgs e)

{

string date = lblDate.Text; //当前日期

string flowId = lblFlowId.Text; //流水号

string payDate = PayDate.Year.ToString() + “年” + PayDate.Month.ToString() + “月”; //应收年月

string adminId = lblAdminId.Text; //操作员编号

string baseExpense = lblBaseExpense.Text; //应交基本费用

string fine = lblFine.Text; //罚款数目

string upExpense = lblUpExpense.Text; //上月上余

string actualExpense = txtActualExpense.Text; //实际应交费用

string chineseExpense = DecimalToChinese.ConvertSum(actualExpense); //实际应交费用的中文大写
   //读取图片模板

Image temp = Image.FromFile(@“Receipts.jpg”);

GetResultIntoImage(ref temp, UserId, flowId, date, baseExpense, fine, upExpense, actualExpense, chineseExpense, payDate, adminId);

int x = e.MarginBounds.X;

int y = e.MarginBounds.Y;

int width = temp.Width;

int height = temp.Height;

Rectangle destRect = new Rectangle(x, y, width, height);

e.Graphics.DrawImage(temp, destRect, 0, 0, temp.Width, temp.Height, System.Drawing.GraphicsUnit.Pixel);

}
        ///

/// 将收费结果填充到图片模板

///

private void GetResultIntoImage(

ref Image temp,

string userId,

string flowId,

string currentDate,

string baseExpense,

string fine,

string upExpense,

string actualExpense,

string chineseExpense,

string payDate,

string adminName)

{

//读取图片模板

Graphics g = Graphics.FromImage(temp);
            Font f = new Font(“宋体”, 12);

Brush b = new SolidBrush(Color.Black);

//填充数据到图片模板(位置要在制作图片模板的时候度量好)

g.DrawImage(temp, 0, 0, temp.Width, temp.Height);

g.DrawString(userId, f, b, 168, 105);

g.DrawString(UserName, f, b, 166, 134);

g.DrawString(flowId, f, b, 535, 105);

g.DrawString(currentDate, f, b, 535, 134);

g.DrawString(baseExpense, f, b, 219, 202);

g.DrawString(fine, f, b, 372, 202);

g.DrawString(upExpense, f, b, 486, 202);

g.DrawString(actualExpense, f, b, 596, 202);

g.DrawString(chineseExpense, f, b, 196, 238);

g.DrawString(payDate, f, b, 176, 269);

g.DrawString(adminName, f, b, 497, 298);
            g.Dispose();

}

#endregion

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值