Class MathRendererPlugin
Class MathRendererPlugin
Namespace: Aspose.TeX.Plugins
Assembly: Aspose.TeX.dll
Lớp plugin MathRenderer.
Ví dụ cho thấy cách để hiển thị một công thức LaTeX ở định dạng PNG.
// Tạo MathRenderer.
MathRendererPlugin renderer = new MathRendererPlugin();
// Tạo thể hiện PngMathRendererPluginOptions và thiết lập các tùy chọn.
PngMathRendererPluginOptions options = new PngMathRendererPluginOptions()
{
BackgroundColor = Color.Yellow,
TextColor = Color.Blue,
Resolution = 150,
Margin = 10,
Preamble = "LaTeX preamble"
};
// Thêm một công thức nguồn.
options.AddInputDataSource(new StringDataSource("Công thức LaTeX"));
// Tạo một luồng để ghi hình ảnh vào.
using (Stream stream = File.Open("đường dẫn đầu ra", FileMode.Create))
{
// Thêm một luồng đầu ra.
options.AddOutputDataTarget(new StreamDataSource(stream));
// Chạy quá trình.
ResultContainer result = renderer.Process(options);
}
public class MathRendererPlugin : IPlugin, IDisposable
Kế thừa
Triển khai
Các thành viên kế thừa
object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Các hàm khởi tạo
MathRendererPlugin()
public MathRendererPlugin()
Các phương thức
Dispose()
Giải phóng thể hiện này.
public void Dispose()
Process(IPluginOptions)
Chạy quá trình Math Renderer với các tham số đã chỉ định.
public ResultContainer Process(IPluginOptions options)
Tham số
options
IPluginOptions
Một đối tượng tùy chọn chứa hướng dẫn cho MathRenderer.
Trả về
Một đối tượng ResultContainer chứa kết quả của hoạt động.
Ngoại lệ
Khi thể hiện tùy chọn được cung cấp là null hoặc có kiểu không phù hợp,
hoặc một trong các nguồn đầu vào/đầu ra có kiểu không được hỗ trợ.