青少年公益口号:急求2幅图象拼接成一幅图象的C++BUILDER或者VC源程序

来源:百度文库 编辑:中科新闻网 时间:2024/05/05 17:03:30
拍2张图象,其中有一部分重叠,
想把这2张图片拼接成一张,请问谁有做过类似的程序或者找到网上的
希望能提供源程序.
如果能用,我将追加100分.谢谢!

TCanvas *ca=new TCanvas;
Graphics::TBitmap b1=new Graphics::TBitmap();
Graphics::TBitmap b2=new Graphics::TBitmap();
Graphics::TBitmap b3=new Graphics::TBitmap();

b1->Picture->LoadFromFile(pic1);
b2->Picture->LoadFromFile(pic2);

b3->Picture->Width=b1->Picture->Width+b2->Picture->Width;//此处可以耕具实际情况更改

b3->Picture->Height=b1->Height>b2->Height?b1->Height:b2->Height;处可以耕具实际情况更改

b3->Canvas->CopyRect(b1->ClientRect,b1->ClientRect,scrCopy);
b3->Canvas->CopyRect(TRect(b1->Width,0,b1->Width+b2->Width,b2->Height),b2->ClientRect,scrCopy);

b3->Picture->SaveToFile(pic3);