Código
Var
Pic : TPicture;
Icone : TIcon;
begin
Icone:= TIcon.Create;
Pic := TPicture.Create;
try
Icone.LoadFromFile(ArquivoIco);
Pic.Icon := Icone;
BitBtn.Glyph := TBitmap.Create;
BitBtn.Glyph.Width := Icone.Width;
BitBtn.Glyph.Height := Icone.Height;
BitBtn.Glyph.Canvas.Draw(0, 0, Pic.Icon);
finally
Pic.Free;
Icone.Free;
end;
end;
{Exemplo: }
procedure TForm1.FormCreate(Sender: TObject);
begin
IcoToBit('C:Icones95.ico', BitBtn1);
end;
Planeta Delphi - www.planetadelphi.com.br - Todos os direitos reservados | Copyright 2001-2009