FMX.Controls.TStyleBook.LoadFromStream
Delphi
procedure LoadFromStream(const Stream: TStream);
C++
void __fastcall LoadFromStream(System::Classes::TStream* const Stream);
Eigenschaften
Typ | Sichtbarkeit | Quelle | Unit | Übergeordnet |
---|---|---|---|---|
procedure function |
public | FMX.Controls.pas FMX.Controls.hpp |
FMX.Controls | TStyleBook |
Beschreibung
Methode zum Laden eines Stils aus einem Stream in ein TStyleBook.
Verwenden Sie LoadFromFile, um einen Stil aus einer Datei zu laden.
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;