六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 41|回复: 0

c#合并多个图片

[复制链接]

升级  74.2%

2220

主题

2220

主题

2220

主题

榜眼

Rank: 8Rank: 8

积分
6710
 楼主| 发表于 2013-1-19 04:09:02 | 显示全部楼层 |阅读模式
private Image combineImages(List<Image> images)
{
Image image =null;
int width = 0, height = 0;
for (int i = 0; i < images.Count; i++)
{
  width = tempImage.Width > width ? tempImage.Width : width;
  height += tempImage.Height + 5;
}
image = new Bitmap(width, height);
Graphics g = Graphics.FromImage(image);
int offset = 0;
foreach (Image tempImage in images)
{
  g.DrawImage(tempImage, new Rectangle(0, offset, tempImage.Width, tempImage.Height));
  offset += tempImage.Height + 5;
}
return image;
}
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表