1using System.Threading.Tasks;
22 : base(Document, Parent)
29 public override string LocalName =>
"ImageResource";
37 set => this.resource = value;
44 public override Task
FromXml(XmlElement Input)
47 return base.FromXml(Input);
56 base.ExportAttributes(Output);
58 this.resource?.
Export(Output);
78 base.CopyContents(Destination);
92 string ResourceName = await this.resource.Evaluate(State.
Session,
string.Empty);
93 if (!
string.IsNullOrEmpty(ResourceName))
96 SKBitmap Bitmap = SKBitmap.Decode(Bin);
97 return SKImage.FromBitmap(Bitmap);
109 base.ExportStateAttributes(Output);
Static class managing loading of resources stored as embedded resources or in content files.
static byte[] LoadResource(string ResourceName)
Loads a resource from an embedded resource.
Contains a 2D layout document.
void Export(XmlWriter Output)
Exports the attribute.
void ExportState(XmlWriter Output)
Exports the state of the attribute.
StringAttribute CopyIfNotPreset(Layout2DDocument ForDocument)
Copies the attribute object if undefined, or defined by an expression. Returns a reference to itself,...
Variables Session
Current session.
Abstract base class for images.
An image defined in an embedded resource.
override string LocalName
Local name of type of element.
override void ExportStateAttributes(XmlWriter Output)
Exports the local attributes of the current element.
override ILayoutElement Create(Layout2DDocument Document, ILayoutElement Parent)
Creates a new instance of the layout element.
ImageResource(Layout2DDocument Document, ILayoutElement Parent)
An image defined in an embedded resource.
override async Task< SKImage > LoadImage(DrawingState State)
Loads the image defined by the element.
override void CopyContents(ILayoutElement Destination)
Copies contents (attributes and children) to the destination element.
override void ExportAttributes(XmlWriter Output)
Exports attributes to XML.
override Task FromXml(XmlElement Input)
Populates the element (including children) with information from its XML definition.
StringAttribute ResourceAttribute
Resource
Layout2DDocument Document
Layout document.
Base interface for all layout elements.
Layout2DDocument Document
Layout document.