image1.loadfromfile(file1.jpg)
image2.loadfromfile1file2.bmp)如何将file1.jpg和file2.bmp的图象内容合成为一个jpg或者bmp图file3.jpg储存.
image3.loadfromfile1file3.bmp)
(格式无所谓,,大小亦不管.关键先合成)
请教大家,谢谢?

解决方案 »

  1.   

    在合成图中.file1,file2左右排列
      

  2.   

    我帮你写写吧,你自己再优化一下.//Form上放上Image1和Image2var
      Bm:TBitmap;
    begin
      //加载
      Image1.Picture.LoadFromFile('C:\1.bmp');
      Image2.Picture.LoadFromFile('C:\2.bmp');
      Try
        Bm:=TBitmap.Create;
        if image1.Picture.Height>=image2.Picture.Height then
          Bm.Height:=image1.Picture.Height
        else
          Bm.Height:=image2.Picture.Height;
        Bm.Width:=image1.Picture.Width+image2.Picture.Width;
        //左右排列
        Bm.Canvas.CopyRect(Rect(0,0,Image1.picture.width,Image1.Picture.Height),Image1.Canvas,Rect(0,0,Image1.picture.width,Image1.picture.height));
        Bm.Canvas.CopyRect(Rect(Image1.picture.width,0,Bm.Width,Bm.Height),Image2.Canvas,Rect(0,0,Image2.picture.width,Image2.picture.height));
        //存储
        Bm.SaveToFile('C:\3.bmp');
      finally
        Bm.Free;
      end;
    end;
      

  3.   

    恩,多谢兄弟,
    1.方法1
    我开始用cavas.draw发现设置了image.stretch=true都不能拉伸.
    就用cavas.stretchdraw实现的.
    2.方法2
    copyrect
    3.方法3
    bit****copy
    4.不知道还有没有
    而且jpg要转化一下注意
    谢谢大家关注