DiagramImageExporter
StockSharp.Xaml.Diagram.Maui.Export
将图导出到MAUI中的图像. 注:完整图像导出执行是平台专用的,可能需要额外的平台专用代码.
方法
ExportToImageAsync
public static Task<byte[]> ExportToImageAsync(GraphicsView diagramView, DiagramExportOptions options)
result = DiagramImageExporter.ExportToImageAsync(diagramView, options)
导出一个图表视图到图像字节数组 。
- diagramView
- The GraphicsView containing the diagram.
- options
- 导出选项 。
返回值: 图像字节数或导出失败时为无效 。
ExportToJpegAsync
public static Task<byte[]> ExportToJpegAsync(GraphicsView diagramView, DiagramExportOptions options)
result = DiagramImageExporter.ExportToJpegAsync(diagramView, options)
将图视图导出到 JPEG 字节数组 。
- diagramView
- The GraphicsView containing the diagram.
- options
- 导出选项 。
返回值: JPEG 图像字节或如果导出失败为无效 。
ExportToPngAsync
public static Task<byte[]> ExportToPngAsync(GraphicsView diagramView, DiagramExportOptions options)
result = DiagramImageExporter.ExportToPngAsync(diagramView, options)
将图视图导出到 PNG 字节数组 。
- diagramView
- The GraphicsView containing the diagram.
- options
- 导出选项 。
返回值: PNG 图像字节, 如果导出失败则无效 。
SaveToFileAsync
public static Task<bool> SaveToFileAsync(GraphicsView diagramView, string filePath, DiagramExportOptions options)
result = DiagramImageExporter.SaveToFileAsync(diagramView, filePath, options)
将图表视图保存到文件。
- diagramView
- The GraphicsView containing the diagram.
- filePath
- 目标文件路径 。
- options
- 导出选项 。
返回值: 成功的话就是真的了