同上
解决方案 »
- tab键转移焦点问题
- WebBrowser失去焦点
- deplhi 中有没有嵌入式 sql ?
- 如何得到组合的结果?
- 为什么在ORACLE的WORKSHEET下面运行能够显示数据,但是在DELPHI里面用DATAGRID就显示不了,??????
- 紧急!不是问题的问题!
- FastReport在header里不能用自带SUM函数?
- 如何通过网络直接连接到联通和移动的短信服务器并可以接收和发送短信!急!
- ^^^^^^^^^谁懂关于磁盘碎片整理的原理和实现方法呢?^^^^^^^^^^
- filter的问题,请高手帮忙,谢谢。
- 请使用 IBX 控件的高手进来
- 一个关于日期时间的问题![在线等待][解决就结贴]
with Image1 do
begin
Strech:=False;
Align:=alClient;
end;
procedure TForm1.FormResize(Sender: TObject);
var
pic: TBitmap;
rect1, rect2: TRect;
x, y: integer;
xm, ym: integer;
i, j: integer;
begin
pic := TBitmap.Create;
pic.LoadFromFile('CIBAS.bmp');
rect1 := rect(0, 0, 0, 0);
rect2 := rect(0, 0, 0, 0);
x := -1; y := -1;
xm := 0; ym := 0; if pic.Width < Width then
begin
rect1.Right := pic.Width;
x := width div pic.Width;
xm := width mod pic.Width;
end else
rect1.Right := Width; if pic.Height< Height then
begin
y := Height div pic.Height;
ym := Height mod pic.Height;
end else
rect1.Bottom := Height; if (x > 0) and (y > 0) then
begin
//for i := 0 to x-1 do
end; if (x > 0) and (y < 0) then
begin
rect2.Top := 0;
rect2.Bottom := Height;
for i := 0 to x-1 do
with Image1.Canvas do
begin
rect2.Left := i* pic.Width;
rect2.Right := (i+1)* pic.Width;
CopyRect(rect2, pic.Canvas, rect1);
CopyMode := cmSrcCopy;
end;
if xm > 0 then
with Image1.Canvas do
begin
rect2.Left := x* pic.Width;
rect2.Right := x* pic.Width+xm;
rect1.Right := xm;
CopyRect(rect2, pic.Canvas, rect1);
CopyMode := cmSrcCopy;
end;
end; if (x < 0) and (y > 0) then
begin
end; if (x < 0) and (y < 0) then
with Image1.Canvas do
begin
CopyRect(ClientRect, pic.Canvas, rect1);
CopyMode := cmSrcCopy;
end;
pic.Free;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
pic: TBitmap;
begin
pic := TBitmap.Create;
try
pic.LoadFromFile('CIBAS.bmp');
Canvas.Brush.Bitmap := pic;
Canvas.FillRect(ClientRect)
finally
Canvas.Brush.Bitmap := nil;
pic.Free;
end;
end;