ITLDG.MauiLed 1.1.1

dotnet add package ITLDG.MauiLed --version 1.1.1                
NuGet\Install-Package ITLDG.MauiLed -Version 1.1.1                
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="ITLDG.MauiLed" Version="1.1.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ITLDG.MauiLed --version 1.1.1                
#r "nuget: ITLDG.MauiLed, 1.1.1"                
#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 ITLDG.MauiLed as a Cake Addin
#addin nuget:?package=ITLDG.MauiLed&version=1.1.1

// Install ITLDG.MauiLed as a Cake Tool
#tool nuget:?package=ITLDG.MauiLed&version=1.1.1                

七段码 LED

该库继承GraphicsView使用IDrawable绘制七段码

效果预览

效果预览

可用属性

属性名 类型 说明
LightColor Color 点亮颜色
DarkColor Color 熄灭颜色
Data byte 七段码数据,解析方法参照七段码解析
Inversion bool 数据反转,反转后七段码数据 0 是点亮,1 是熄灭

使用示例

xmlns:itldg="clr-namespace:ITLDG.MauiLed;assembly=ITLDG.MauiLed"

....

<itldg:LedView Data="255" HeightRequest="80" WidthRequest="52" NightColor="Black" LightColor="OrangeRed" />

<itldg:LedView Data="255" HeightRequest="80" WidthRequest="52" Inversion="true" />

<itldg:LedView Data="{Binding Val}" HeightRequest="80" WidthRequest="52" LightColor="Green" Inversion="true"/>

七段码解析

默认 1 表示点亮 0 表示熄灭 下图表示 Bit 位与七段码的对应关系

七段码

扩展方法

方法 说明
LedData.GetText(byte data, bool inversion = false) 获取展示字符,获取不到返回问号(?)
LedData.HasDecimalPoint(byte data, bool inversion = false) 该数据是否包含小数点
LedData.GetData(char str, bool inversion = false) 获取字符对应的七段码数据
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.
  • net7.0

    • No dependencies.

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
1.1.1 79 12/12/2024
1.0.0 254 11/18/2023