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下却不可以用,为什么?
解决方案 »
- 如何在DELPHI中返回SQL的错误,并形成相应的异常类
- 关于一个多线程问题,我最多只能给200分。大家来帮看看,顶的有分!
- 我想在对文件的操作时直接对文件进行删除,请问该怎么做?
- 怎样在客户端执行程序生成一个SqlServer数据库到服务器上,数据库名每一次都不一样!欢迎高手讨论!
- 用InstallShield Develop 8如何把BDE打包进去?
- 我想问一下各位你们在调试存储过程的时候都用到了
- 去掉IE广告的方法
- 巨菜的问题!
- 我想用TWebBrowser写个小程序代我自动登录莫个网站,送分请教:
- 在网上给手机、呼机发信息?
- 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;