_homeShareTemplate.Generate(new TemplateItem[] //Generate返回新的Bitmap
{
new StringTemplateItem() //日期
{
Location = new Point(80 * 2, 782),
Font = new Font(“宋体”, 42, FontStyle.Bold, GraphicsUnit.Pixel),
Color = Color.FromArgb(0x8e, 0x1a, 0x22),
Value = DateTime.Now.ToString(“yyyy.MM.dd”),
Horizontal = HorizontalPosition.Center
},
new StringTemplateItem() //农历
{
Location = new Point(2302, 1662),
//MaxWidth = 15,
Font = new Font(“宋体”, 22, FontStyle.Bold, GraphicsUnit.Pixel),
Color = Color.FromArgb(0x8e, 0x1a, 0x22),
StringFormat = new StringFormat(StringFormatFlags.DirectionVertical),
Value = GetMonthCalendar(DateTime.Now)
},
new StringTemplateItem() //星期
{
Location = new Point(2562, 1752),
//MaxWidth = 15,
Font = new Font(“宋体”, 24, FontStyle.Bold, GraphicsUnit.Pixel),
Color = Color.FromArgb(0x8e, 0x1a, 0x22),
StringFormat = new StringFormat(StringFormatFlags.DirectionVertical),
Value = GetWeekName(DateTime.Now)
},
new ImageTemplateItem() //图片
{
Image = (Bitmap) Bitmap.FromFile(Path.Join(Directory.GetCurrentDirectory(),weather.MainImageUrl)),
Location = new Point(812, 1082),
Size = new Size(1322, 1332)
},
new StringTemplateItem()
{
Location = new Point(882, 2572),
MaxWidth = 1252,
Font = new Font(“楷体”, 30, FontStyle.Bold, GraphicsUnit.Pixel),
Color = Color.FromArgb(0x17, 0x14, 0x0e),
Value = weather.Content.Left(44)
},
new StringTemplateItem() //宜
{
Location = new Point(352+3,2942),
Color = Color.FromArgb(0x8f, 0x1A, 0x22),
Font = new Font(“宋体”, 38, FontStyle.Bold, GraphicsUnit.Pixel),
StringFormat = new StringFormat(StringFormatFlags.DirectionVertical),
//MaxWidth = 14,
Value = weather.Yi.Left(4)
},
new StringTemplateItem() //忌
{
Location = new Point(2282+3,2942),
Color = Color.FromArgb(0x8f, 0x1A, 0x22),
Font = new Font(“宋体”, 38, FontStyle.Bold, GraphicsUnit.Pixel),
StringFormat = new StringFormat(StringFormatFlags.DirectionVertical),
//MaxWidth = 14,
Value = weather.Ji.Left(4)
},
new QrCodeTemplateItem() //二维码
{
Location = new Point(1882, 4212),
Size = new Size(732, 722),
QrCode = “http://ssssss.com/sdfsdfsdfs/sss”
}
});
深圳网站建设 www.sz886.com