TImage 画 .Ico 图标,我想水平居中,垂直居上怎么办?救命哦..... ( 积分: 100 )

  • 主题发起人 主题发起人 LiGen
  • 开始时间 开始时间
L

LiGen

Unregistered / Unconfirmed
GUEST, unregistred user!
TImage 画 .Ico 图标,我想横居中,垂直居上
设置 center := True
得到上下左右居中,可我想 横居中,垂直居上 ,想了好久,无法实现,大虾救命。
 
TImage 画 .Ico 图标,我想横居中,垂直居上
设置 center := True
得到上下左右居中,可我想 横居中,垂直居上 ,想了好久,无法实现,大虾救命。
 
procedure TForm1.Image1DblClick(Sender: TObject);
var
ico:TIcon;
x,w:Integer;
begin
ico :=TIcon.Create;
try
ico.LoadFromFile('test.ico');
//Image1.Picture.Assign(ico);
w :=ico.Width;
x :=(Image1.Width-w) div 2;
Image1.Canvas.Draw(x,0,ico);
finally
ico.Destroy;
end;
end;
 
谢谢downSong,
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
I
回复
0
查看
641
import
I
后退
顶部