Class FigureRendererPlugin
Class FigureRendererPlugin
Namespace: Aspose.TeX.Plugins
Assembly: Aspose.TeX.dll
图形渲染插件类。
示例展示如何将 LaTeX 片段渲染为 PNG。
// 创建图形渲染器。
FigureRendererPlugin renderer = new FigureRendererPlugin();
// 创建 PngFigureRendererPluginOptions 实例并设置选项。
PngFigureRendererPluginOptions options = new PngFigureRendererPluginOptions()
{
BackgroundColor = Color.Yellow,
Resolution = 150,
Margin = 10,
Preamble = "LaTeX preamble"
};
// 添加输入 LaTeX 片段。
options.AddInputDataSource(new StringDataSource("LaTeX fragment"));
// 创建一个流以将图像写入。
using (Stream stream = File.Open("output path", FileMode.Create))
{
// 添加输出流。
options.AddOutputDataTarget(new StreamDataSource(stream));
// 运行处理。
ResultContainer result = renderer.Process(options);
}
public class FigureRendererPlugin : IPlugin, IDisposable
继承
实现
继承成员
object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
构造函数
FigureRendererPlugin()
public FigureRendererPlugin()
方法
Dispose()
释放此实例。
public void Dispose()
Process(IPluginOptions)
使用指定参数运行图形渲染处理。
public ResultContainer Process(IPluginOptions options)
参数
options
IPluginOptions
一个包含图形渲染器指令的选项对象。
返回
一个包含操作结果的 ResultContainer 对象。
异常
当给定的选项实例为 null 或具有不适当的类型,或输入/输出源之一具有不支持的类型时。