Updated: Dec 16, 2023
Follow on twitter

Loading skin from TMemoryStream.

The TsSkinManager component supports easy embedding of skins into application by few mouse clicks.

But, sometimes may be required to store skins in a stream. Any skin may be stored in a stream and may be loaded to the TsSkinManager.InternalSkins collection for futher activating. Code for a skin loading:

ms: TMemoryStream; // Stream with skin data sm: TsSkinManager; // SkinManager where skin must be loaded ... const SkinName = 'Skin loaded from stream'; begin sm.InternalSkins.Add; // New internal skin creation sm.InternalSkins[sm.InternalSkins.Count - 1].Name := SkinName; sm.InternalSkins[sm.InternalSkins.Count - 1].PackedData.LoadFromStream(ms); sm.SkinName := SkinName; // Changing of current skin name sm.Active := True; // Activate skin if not activate yet end;

Here is a full demo with sources and compiled exe.






Installing, using and licensing the demo programs © Sergii Goncharov, Ukraine, Odessa 2004-2023