FMX.Controls.TStyleBook.LoadFromStream

De RAD Studio API Documentation
Aller à : navigation, rechercher

Delphi

procedure LoadFromStream(const Stream: TStream);

C++

void __fastcall LoadFromStream(System::Classes::TStream* const Stream);

Propriétés

Type Visibilité  Source Unité  Parent
procedure
function
public
FMX.Controls.pas
FMX.Controls.hpp
FMX.Controls TStyleBook


Description

Méthode pour charger un style dans un TStyleBook à partir d'un flux.

Pour charger le style depuis un fichier, utilisez LoadFromFile.

procedure TForm1.FormCreate(Sender: TObject);
var
  S: TFileStream; 
begin
  S :=  TFileStream.Create('Air.Style', fmOpenRead);
  Stylebook1.LoadFromStream(S);
end;
procedure TForm2.FormCreate(Sender: TObject);
var
  iStream: TMemoryStream;
begin
  StyleBook1.LoadFromFile('Air.Style'); //Loads the style from a file.
  iStream := TMemoryStream.Create; //Instanziate the memory stream var.
  TStyleStreaming.SaveToStream(StyleBook1.Style, iStream); //saves the style as a memory stream.
  StyleBook1.Clear; //Clear the styles from the stylebook.
  iStream.Position := 0; //Sets the position to start the streaming.
  StyleBook1.LoadFromStream(iStream); //Loads the style to the stylebook from the memory stream.
end;

Voir aussi