2using System.Threading.Tasks;
23 : base(Document, Parent)
30 public override string LocalName =>
"ImageInternal";
38 set => this.cid = value;
45 public override Task
FromXml(XmlElement Input)
49 return base.FromXml(Input);
58 base.ExportAttributes(Output);
80 base.CopyContents(Destination);
94 string ContentId = await this.cid.Evaluate(State.
Session,
string.Empty);
95 if (
string.IsNullOrEmpty(ContentId))
99 return Content as SKImage;
103 object Obj = v.ValueObject;
105 if (Obj is SKImage
Image)
109 return Pixels.CreateBitmap();
118 return await this.
Document.RaiseGetInternalImage(ContentId);
127 base.ExportStateAttributes(Output);
Contains a 2D layout document.
bool TryGetContent(string ContentId, out object Content)
Tries to get content from attached content.
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 provided by the caller, identified by a content id.
StringAttribute CidAttribute
Content ID
override ILayoutElement Create(Layout2DDocument Document, ILayoutElement Parent)
Creates a new instance of the layout element.
override void ExportAttributes(XmlWriter Output)
Exports attributes to XML.
ImageInternal(Layout2DDocument Document, ILayoutElement Parent)
An image provided by the caller, identified by a content id.
override Task FromXml(XmlElement Input)
Populates the element (including children) with information from its XML definition.
override void ExportStateAttributes(XmlWriter Output)
Exports the local attributes of the current element.
override async Task< SKImage > LoadImage(DrawingState State)
Loads the image defined by the element.
override string LocalName
Local name of type of element.
override void CopyContents(ILayoutElement Destination)
Copies contents (attributes and children) to the destination element.
Layout2DDocument Document
Layout document.
PixelInformation CreatePixels()
Creates a bitmap of the graph.
Contains information about a variable.
virtual bool TryGetVariable(string Name, out Variable Variable)
Tries to get a variable object, given its name.
Base interface for all layout elements.
Layout2DDocument Document
Layout document.