3using System.Threading.Tasks;
38 ImageCodec.ContentTypeSvg
55 string GraphDescription;
57 using (StreamReader rd =
new StreamReader(State.
From))
59 GraphDescription = rd.ReadToEnd();
67 s = s.Substring(0, i);
79 s = s.Substring(0, i);
92 Language = Path.GetExtension(State.
FromFileName).ToLower();
93 if (Language.StartsWith(
"."))
94 Language = Language.Substring(1);
117 Graph = await
GraphViz.GetFileName(Language, GraphDescription, ResultType.Svg,
true,
Variables);
122 Graph = await
GraphViz.GetFileName(Language, GraphDescription, ResultType.Png,
true,
Variables);
130 await State.
To.WriteAsync(Data, 0, Data.Length);
Contains the state of a content conversion process.
string ToContentType
Content type of the content to convert to. This value might be changed, in case the converter finds a...
string[] PossibleContentTypes
Possible content types the converter is allowed to convert to. Can be null if there are no alternativ...
string FromContentType
Content type of the content to convert from.
Stream To
Stream pointing to where binary representation of content is to be sent.
string FromFileName
If the content is coming from a file, this parameter contains the name of that file....
Stream From
Stream pointing to binary representation of content.
const string ContentTypePng
image/png
const string ContentTypeSvg
image/svg+xml
Converts GraphViz documents to images.
string[] FromContentTypes
Converts content from these content types.
virtual string[] ToContentTypes
Converts content to these content types.
async Task< bool > ConvertAsync(ConversionState State)
Performs the actual conversion.
virtual Grade ConversionGrade
How well the content is converted.
GraphVizDocumentToImageConverter()
Converts GraphViz documents to images.
Class managing GraphViz integration into Markdown documents.
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.
Basic interface for Internet Content encoders. A class implementing this interface and having a defau...