GDI+图像合并

来源:互联网 发布:js级联菜单 编辑:程序博客网 时间:2024/06/06 10:05

一、图像拼接,图像合并,将两张图片合成一张图片

Image* FixedSize3(Image *imgSrc1, Image *imgSrc2){Bitmap *bmPhoto = new Bitmap(imgSrc1->GetWidth()+ imgSrc2->GetWidth(), imgSrc1->GetHeight());bmPhoto->SetResolution(imgSrc1->GetHorizontalResolution(), imgSrc1->GetVerticalResolution());Graphics grPhoto(bmPhoto);grPhoto.SetInterpolationMode(InterpolationModeHighQualityBicubic);grPhoto.DrawImage(imgSrc1, 0, 0);grPhoto.DrawImage(imgSrc2, imgSrc1->GetWidth(), 0);return bmPhoto;}

原理:第一创建一个新区域,将多了图片依次画到新区域即可实现拼接。



原创粉丝点击