c# 图片绘制速度
合成图片源码:
elements是6个Bitmap对象数组
合成一张图片的时间约莫1秒,由于项目每次要多次合成图片,每次要耗费时间7、8秒,速度太慢,希望高手提供更好的方法!
this.s_image = new Bitmap(this.Body.Width, this.Body.Height);
Graphics g = Graphics.FromImage(this.s_image);
for (int i = 0; i < elements.Length; i++)
{
if (elements[i] != null)
{
if (i != 4)
{
g.DrawImage(elements[i], p_list.PointArray[i].X, p_list.PointArray[i].Y, this.Body.Width, this.Body.Height);
}
else
{
if (has_glassses)
{
g.DrawImage(elements[i], p_list.PointArray[i].X, p_list.PointArray[i].Y, this.Body.Width, this.Body.Height);
}
}
}
}
g.Dispose();