FMX.Controls.TStyleBook.LoadFromStream

提供: RAD Studio API Documentation
移動先: 案内検索

Delphi

procedure LoadFromStream(const Stream: TStream);

C++

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

プロパティ

種類 可視性 ソース ユニット
procedure
function
public
FMX.Controls.pas
FMX.Controls.hpp
FMX.Controls TStyleBook


説明

スタイルをストリームから TStyleBook へ読み込むためのメソッドです。

ファイルからスタイルを読み込むには、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;

関連項目