主窗体代码如下:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Drawing.Drawing2D;
public partial class Form5 : Form
{
public Form5()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Image imgBg = ReturnImage("bg.jpg");//背景图片
Bitmap bmp = new Bitmap(imgBg.Width, imgBg.Height);
using (Graphics g = Graphics.FromImage(bmp))
{
g.DrawImage(imgBg, 0, 0);
Font font = new Font("宋体", 25, FontStyle.Bold);
string s = Calendar.GetCalendar(DateTime.Now.Year, DateTime.Now.Month);
g.DrawString(s, font, new SolidBrush(Color.Yellow), imgBg.Width - 400, 10);
bmp.Save("new.jpg", S