procedure TForm1.BitBtn1Click(Sender: TObject);
var
x:integer;
y:integer;
src,drc:TRect;
bmp:TBitmap;
begin
bmp:=TBitmap.Create;
x:=Image1.Width;
y:=Image1.Height;
bmp.Width:=x;
bmp.Height:=y;
src:=Rect(0,0,x,y);
drc:=Rect(x,0,0,y);
bmp.PixelFormat:=TPixelFormat.pf32bit;
Image2.Width:=x;
Image2.Height:=y;//ShowMessage(IntToStr(integer(bmp.PixelFormat)));
Image2.Picture.Bitmap.PixelFormat:=TPixelFormat.pf32bit;
ShowMessage(IntToStr(integer(Image1.Picture.Bitmap.PixelFormat)));
ShowMessage(IntToStr(integer(Image2.Picture.Bitmap.PixelFormat)));
bmp.LoadFromFile('ok.bmp');
bmp.Width:=x;
bmp.Height:=y;
bmp.Canvas.CopyMode:=Graphics.cmSrcCopy;
bmp.Canvas.CopyRect(drc,Image1.Picture.Bitmap.Canvas,src);
Image2.Canvas.CopyMode:=Graphics.cmSrcCopy;
Image2.Canvas.CopyRect(drc,bmp.Canvas,src);
//Image2.Picture.Bitmap.Assign(bmp);
//bmp.SaveToFile('o2.bmp');
bmp.Destroy;
end;这个代码在DELPHI下可以用。在LAZARUS下却不可以用,为什么?
var
x:integer;
y:integer;
src,drc:TRect;
bmp:TBitmap;
begin
bmp:=TBitmap.Create;
x:=Image1.Width;
y:=Image1.Height;
bmp.Width:=x;
bmp.Height:=y;
src:=Rect(0,0,x,y);
drc:=Rect(x,0,0,y);
bmp.PixelFormat:=TPixelFormat.pf32bit;
Image2.Width:=x;
Image2.Height:=y;//ShowMessage(IntToStr(integer(bmp.PixelFormat)));
Image2.Picture.Bitmap.PixelFormat:=TPixelFormat.pf32bit;
ShowMessage(IntToStr(integer(Image1.Picture.Bitmap.PixelFormat)));
ShowMessage(IntToStr(integer(Image2.Picture.Bitmap.PixelFormat)));
bmp.LoadFromFile('ok.bmp');
bmp.Width:=x;
bmp.Height:=y;
bmp.Canvas.CopyMode:=Graphics.cmSrcCopy;
bmp.Canvas.CopyRect(drc,Image1.Picture.Bitmap.Canvas,src);
Image2.Canvas.CopyMode:=Graphics.cmSrcCopy;
Image2.Canvas.CopyRect(drc,bmp.Canvas,src);
//Image2.Picture.Bitmap.Assign(bmp);
//bmp.SaveToFile('o2.bmp');
bmp.Destroy;
end;这个代码在DELPHI下可以用。在LAZARUS下却不可以用,为什么?
解决方案 »
- 自认为是高难度问题,高手请进,看是否有办法解决,谢谢!
- 如何对文件进行加密/解密?
- 我在新浪注册了一个免费邮箱利用SMTP,在程序中发送一个邮件,结果发到对方垃圾箱了。
- 计算查询到的记录,在线急
- 数据财出.
- 急用!求 对实数进行“四舍五入”的函数!
- 请教dephi做过direct方面的高手或用过delphix控件的高手.....
- 如何实现将文件拖放到Button1和Memo1上后得到其文件名
- 我这个win2000程序如何移植到98上去?
- dbedit!!!
- TTabControl设计时和运行时的样子怎么不相同咧!
- 正则匹配(\s|''|\))中的任意一个,但是如果是AB')CD就会把')匹配在一起
var
x: integer;
y: integer;
src, drc: TRect;
bmp: TBitmap;
begin
bmp := TBitmap.Create;
x := Image2.Width;
y := Image2.Height;
bmp.Width := x;
bmp.Height := y;
src := Rect(0, 0, x, y);
drc := Rect(x, 0, 0, y);
//bmp.PixelFormat := TPixelFormat.pf32bit;
Image2.Width := x;
Image2.Height := y; //ShowMessage(IntToStr(integer(bmp.PixelFormat)));
//Image2.Picture.Bitmap.PixelFormat := TPixelFormat.pf32bit;
bmp.LoadFromFile('ok.bmp');
bmp.Width := x;
bmp.Height := y;
//bmp.Canvas.CopyMode := Graphics.cmSrcCopy;
//bmp.Canvas.CopyRect(drc, Image2.Picture.Bitmap.Canvas, src);
Image2.Canvas.CopyMode := Graphics.cmSrcCopy;
Image2.Canvas.CopyRect(drc, bmp.Canvas, src);
//Image2.Picture.Bitmap.Assign(bmp);
//bmp.SaveToFile('o2.bmp');
bmp.Destroy;
end;