H
handll
Unregistered / Unconfirmed
GUEST, unregistred user!
我需要一个图片合并过程,这是我的实现过程,但提示“Bitmap image is not valid”的错误提示,是怎么回事呢?你有解决方法么?
注: 过程功能 是把picpath1 和 picPath2路径的图片纵向合并为新的图片路径picPath
必须(或最好)在一个过程内完成此功能
procedure Bind(picPath1 : string; picPath2 : string; picPath: string);
var
myrect1 : TRect;
myrect2 : TRect;
bmps,bmp1,bmp2 : TBitmap;
begin
bmps := TBitmap.Create;
bmp1 := TBitmap.Create;
bmp2 := TBitmap.Create;
bmp1.LoadFromFile(picPath1);
bmp2.LoadFromFile(picPath2);
bmps.Height := bmp1.Height + bmp2.Height;
myrect1 := Rect(0,0,bmp1.Width,bmp1.Height);
myrect2 := Rect(0,bmp1.Height,bmp2.Width,bmp1.Height + bmp2.Height);
bmps.Canvas.StretchDraw(myrect1,bmp1);
bmps.Canvas.StretchDraw(myrect2,bmp2);
bmps.SaveToFile(picPath);
end;
谢谢你的过目!!
注: 过程功能 是把picpath1 和 picPath2路径的图片纵向合并为新的图片路径picPath
必须(或最好)在一个过程内完成此功能
procedure Bind(picPath1 : string; picPath2 : string; picPath: string);
var
myrect1 : TRect;
myrect2 : TRect;
bmps,bmp1,bmp2 : TBitmap;
begin
bmps := TBitmap.Create;
bmp1 := TBitmap.Create;
bmp2 := TBitmap.Create;
bmp1.LoadFromFile(picPath1);
bmp2.LoadFromFile(picPath2);
bmps.Height := bmp1.Height + bmp2.Height;
myrect1 := Rect(0,0,bmp1.Width,bmp1.Height);
myrect2 := Rect(0,bmp1.Height,bmp2.Width,bmp1.Height + bmp2.Height);
bmps.Canvas.StretchDraw(myrect1,bmp1);
bmps.Canvas.StretchDraw(myrect2,bmp2);
bmps.SaveToFile(picPath);
end;
谢谢你的过目!!