LVGLSharp.Native 9.0.3.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package LVGLSharp.Native --version 9.0.3.2
                    
NuGet\Install-Package LVGLSharp.Native -Version 9.0.3.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="LVGLSharp.Native" Version="9.0.3.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LVGLSharp.Native" Version="9.0.3.2" />
                    
Directory.Packages.props
<PackageReference Include="LVGLSharp.Native" />
                    
Project file
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 LVGLSharp.Native --version 9.0.3.2
                    
#r "nuget: LVGLSharp.Native, 9.0.3.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.
#:package LVGLSharp.Native@9.0.3.2
                    
#: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=LVGLSharp.Native&version=9.0.3.2
                    
Install as a Cake Addin
#tool nuget:?package=LVGLSharp.Native&version=9.0.3.2
                    
Install as a Cake Tool

LVGLSharp.Forms

中文 | English

LVGLSharp.Forms 是一个跨平台的 WinForms API 兼容层,以 LVGL 作为底层渲染引擎。目标是实现所见即所得——在 Visual Studio Windows Forms 设计器中设计的界面,可以在 Linux(arm / arm64 / x64)等嵌入式平台上以高度一致的效果运行。

⚠️ 项目目前处于试验阶段,尚不可用于生产环境。


✨ 特性

  • 🖥️ WinForms API 兼容:使用与 System.Windows.Forms 高度相似的 API,轻松迁移现有代码。
  • 🔤 LVGL 全 API 互操作:基于 ClangSharpPInvokeGenerator 自动生成的 P/Invoke 绑定,覆盖 LVGL 全部 C API。
  • 🚀 NativeAOT 支持:支持发布为无依赖的原生可执行文件(已验证 win-x64 / linux-arm)。
  • 🌍 跨平台:支持 Windows(x86 / x64 / arm64)、Linux(x64 / arm / arm64)。
  • 🧩 内置常用控件:Button、Label、TextBox、CheckBox、RadioButton、ComboBox、ListBox、ProgressBar、TrackBar、NumericUpDown、PictureBox、Panel、GroupBox、FlowLayoutPanel、TableLayoutPanel、RichTextBox 等。
  • 🎨 自定义绘图类型:提供 LVGLSharp.Darwing 命名空间下的 SizePointColor 等类型,无需依赖 System.Drawing,天然跨平台。

📷 预览

以下为经过 NativeAOT 发布的 win-x64 / linux-arm 应用程序预览(无任何额外依赖):

<iframe src="//player.bilibili.com/player.html?isOutside=true&aid=116237182962589&bvid=BV12Fwjz5EuZ&cid=36733586714&p=1" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"></iframe>


📦 NuGet 包

包名 说明
LVGLSharp.Forms WinForms API 兼容层(核心包)
LVGLSharp.Interop LVGL P/Invoke 绑定(自动生成)
LVGLSharp.Native 各平台 LVGL 原生库(win-x86 / win-x64 / win-arm64、linux-arm 等)

🚀 快速开始

1. 创建项目

推荐按仓库中的示例采用多目标框架的方式:使用 Visual Studio 创建 Windows Forms 应用程序(.NET),以 net10.0-windows 目标启用设计器(UseWindowsForms=true),再增加一个纯 net10.0 目标用于跨平台运行并在该目标下引用 LVGLSharp.Forms。可参考示例工程的配置:src/Demos/WinFormsDemo/WinFormsDemo.csproj

2. 入口程序

using LVGLSharp.Forms;

Application.SetHighDpiMode(HighDpiMode.SystemAware);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new frmMain());

3. 在 Linux 上运行

使用 NativeAOT 发布:

dotnet publish -r linux-arm64 -c Release

🏗️ 项目结构

src/
├── LVGLSharp.WinForms/     # WinForms API 兼容层(核心)
│   ├── Forms/              # 控件实现(Control、Form、Button 等)
│   ├── Darwing/            # 跨平台绘图类型(Size、Point、Color 等)
│   └── Runtime/            # 平台运行时(Windows / Linux)
├── LVGLSharp.Interop/      # LVGL P/Invoke 自动生成绑定
├── LVGLSharp.Native/       # 各平台原生库
├── LVGLSharp.Core/         # 公共核心库
└── Demos/
    └── WinFormsDemo/       # 演示项目
libs/
└── lvgl/                   # LVGL 源码(submodule)

🙏 致谢


💬 交流

欢迎加入微信群,与我们交流项目使用、跨平台适配、控件实现与问题排查经验。

如果你对 LVGLSharp.Forms 感兴趣,欢迎扫码加入微信群交流。

LVGLSharp 微信交流群


📄 许可证

本项目基于 MIT License 开源。

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

  • .NETStandard 2.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on LVGLSharp.Native:

Package Downloads
LVGLSharp.Interop

Auto-generated low-level P/Invoke bindings for LVGL, generated through ClangSharpPInvokeGenerator and intended for advanced integrations, custom hosts, and full C API access from .NET.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
9.5.1 143 3/30/2026
9.5.0.3 139 3/24/2026
9.5.0.2 83 3/24/2026
9.5.0.1 153 3/23/2026
9.3.0.5 131 3/17/2026
9.3.0.3 120 3/17/2026
9.3.0.1 110 3/16/2026
9.0.3.2 111 3/16/2026
0.0.3 103 3/15/2026
0.0.2 103 3/15/2026