一、图像拼接,图像合并,将两张图片合成一张图片
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;
}
原理:第一创建一个新区域,将多了图片依次画到新区域即可实现拼接。