日期:2014-05-17  浏览次数:20575 次

多张二进制图,如何显示在一个页面上?

System.Drawing.Image MyImage = System.Drawing.Image.FromStream(new MemoryStream(二进制图));
MyImage.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg);


目前通过这种方式只能每次显示一张。
我想实现的是,一个页面同时显示多张。

------解决方案--------------------
//合并图片
        public Bitmap MergerImg(Bitmap[] maps, System.Web.UI.WebControls.RepeatDirection RepeatDirection)
        {
            if (maps.Length == 0)
                throw new Exception("图片数不能够为0");

            int _width = 0;
            int _height = 0;
            for (int i = 0; i < maps.Length; i++)
            {
                if (RepeatDirection == System.Web.UI.WebControls.RepeatDirection.Horizontal)
                {
                    _width += maps[i].Width;
                    if (maps[i].Height > _height)
                    {
                        _height = maps[i].Height;
                    }
                }
                else