NScript.Plot 7.0.2

dotnet add package NScript.Plot --version 7.0.2                
NuGet\Install-Package NScript.Plot -Version 7.0.2                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NScript.Plot" Version="7.0.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add NScript.Plot --version 7.0.2                
#r "nuget: NScript.Plot, 7.0.2"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install NScript.Plot as a Cake Addin
#addin nuget:?package=NScript.Plot&version=7.0.2

// Install NScript.Plot as a Cake Tool
#tool nuget:?package=NScript.Plot&version=7.0.2                

NScript.Plot

NScript.Plot 基于 Avalonia,提供一系列 plot 服务,方便进行内容展示。当前版本只支持图像和视频/序列图像的展示。 using NScript.Plot 后,对于下属类型的实例,可以直接通过 Show 扩展方法来显示内容:

  • [SkiaSharp] SKBitmap
  • [SkiaSharp] Func<SKBitmap>
  • [SkiaSharp] IEnumerable<SKBitmap>
  • [Geb.Image] ImageBgr24
  • [Geb.Image] ImageBgra32
  • [Geb.Image] Func<ImageBgr24>
  • [Geb.Image] Func<ImageBgra32>
  • [Geb.Image] IEnumerable<ImageBgr24>
  • [Geb.Image] IEnumerable<ImageBgra32>

对于 Func<T> 类型的实例,当返回 null 时,停止显示序列图像。

示例代码:

(1) 显示图像:

var img = new ImageBgr24(200, 200).Fill(Bgr24.RED);
img.Show("红色图像");

(2)显示视频

var file = "D:\\test\\派蒙生气成长史.mp4";
Geb.Media.IO.VideoFile.ForEach(file).Show("演示视频");

(3)显示视频,但显示前对图像进行处理

var file = "D:\\test\\派蒙生气成长史.mp4";
Geb.Media.IO.VideoFile.ForEach(file, 0.1f, (float time, float duration, ImageBgr24 img) =>
{
    // 在画面上打印当前帧时间
    img.DrawText($"{time.ToString("0.00")}/{duration.ToString("0.00")} s", Bgr24.WHITE, new PointS(10, 2));
}).Show("演示视频");
Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
7.0.2 189 12/21/2023
7.0.1 114 12/21/2023
6.0.1 195 6/20/2022
6.0.0 185 6/20/2022