SkiaSharp.TimeLine
1.0.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package SkiaSharp.TimeLine --version 1.0.0
NuGet\Install-Package SkiaSharp.TimeLine -Version 1.0.0
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="SkiaSharp.TimeLine" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SkiaSharp.TimeLine" Version="1.0.0" />
<PackageReference Include="SkiaSharp.TimeLine" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SkiaSharp.TimeLine --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: SkiaSharp.TimeLine, 1.0.0"
#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.
#:package SkiaSharp.TimeLine@1.0.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SkiaSharp.TimeLine&version=1.0.0
#tool nuget:?package=SkiaSharp.TimeLine&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
如何使用
组装要显示的数据
/// <summary>
/// 组装要显示的数据
/// </summary>
/// <returns></returns>
private List<TimeLineData> BuildDatas()
{
return new List<TimeLineData>
{
new TimeLineData { Index = 1, Title = "1949年", Description = "中华人民共和国成立" },
new TimeLineData { Index = 2, Title = "1971年", Description = "恢复联合国合法席位" },
new TimeLineData { Index = 3, Title = "1997年", Description = "香港回归祖国" },
new TimeLineData { Index = 4, Title = "1999年", Description = "澳门回归祖国" },
new TimeLineData { Index = 5, Title = "2001年", Description = "加入世界贸易组织" },
new TimeLineData { Index = 6, Title = "2021年", Description = "中国共产党成立 100 周年" },
new TimeLineData { Index = 7, Title = "2022年", Description = "党的二十大召开" },
new TimeLineData { Index = 8, Title = "2023年", Description = "C919 大型客机完成首个商业航班飞行" },
new TimeLineData { Index = 9, Title = "2024年", Description = "嫦娥六号任务发射" },
new TimeLineData { Index = 10, Title = "2025年", Description = "世界反法西斯战争胜利 80 周年" },
new TimeLineData { Index = 11, Title = "2026年", Description = "中国全固态电池装车" }
};
}
背景图片信息
//背景图片信息
var imageInfo = new ImageInfo
{
ImageWidth = 1000,//图片宽度
ImageHeight = 1000,//图片高度
Color = SKColors.White,//图片颜色
ImageFormat = SKEncodedImageFormat.Png,//图片格式
}
线条信息
//线条信息
var lineInfo = new LineInfo
{
LineSectionLength = 100,//线段长度
StartPoint = new SKPoint(50, 200),//线条的起始点
Color = SKColors.Black,//线条颜色
Width = 3,//线条宽度
TitleColor = SKColors.Gray,//标题颜色
TitleFont = new SKFont(SKTypeface.FromFamilyName("Microsoft YaHei"), 14),//标题字体
DescColor = SKColors.Blue,//描述颜色
DescFont = new SKFont(SKTypeface.FromFamilyName("Microsoft YaHei"), 14),//描述字体
Direction = LineDirection.Right//线条方向
}
圆圈信息
//圆圈信息
var circleInfo = new CircleInfo
{
Radius = 10,//圆圈半径
Color = SKColors.Black,//圆圈颜色
PaintStyle = SKPaintStyle.Stroke//圆圈画笔风格
}
生成时间轴图片流
//生成时间轴图片流
var timeLineStream = TimeLineUtility.PaintLine(BuildDatas(),imageInfo,lineInfo,circleInfo)
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 is compatible. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.1
- SkiaSharp (>= 3.119.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
目前只实现了线条向右