2using System.Threading.Tasks;
23 : base(Document, Parent)
38 set => this.fileName = value;
45 public override Task
FromXml(XmlElement Input)
48 return base.FromXml(Input);
57 base.ExportAttributes(Output);
59 this.fileName?.
Export(Output);
79 base.CopyContents(Destination);
93 string FileName = await this.fileName.Evaluate(State.
Session,
string.Empty);
94 if (!
string.IsNullOrEmpty(FileName) && File.Exists(FileName))
97 SKBitmap Bitmap = SKBitmap.Decode(Bin);
98 return SKImage.FromBitmap(Bitmap);
110 base.ExportStateAttributes(Output);
Static class managing loading of resources stored as embedded resources or in content files.
static async Task< byte[]> ReadAllBytesAsync(string FileName)
Reads a binary file asynchronously.
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.
An image defined in a file.
override void CopyContents(ILayoutElement Destination)
Copies contents (attributes and children) to the destination element.
StringAttribute FileNameAttribute
Filename
override ILayoutElement Create(Layout2DDocument Document, ILayoutElement Parent)
Creates a new instance of the layout element.
override Task FromXml(XmlElement Input)
Populates the element (including children) with information from its XML definition.
ImageFile(Layout2DDocument Document, ILayoutElement Parent)
An image defined in a file.
override void ExportStateAttributes(XmlWriter Output)
Exports the local attributes of the current element.
override string LocalName
Local name of type of element.
override async Task< SKImage > LoadImage(DrawingState State)
Loads the image defined by the element.
override void ExportAttributes(XmlWriter Output)
Exports attributes to XML.
Abstract base class for images.
Layout2DDocument Document
Layout document.
Base interface for all layout elements.
Layout2DDocument Document
Layout document.