nanoFramework.Graphics
1.0.3.4
Prefix Reserved
See the version list below for details.
dotnet add package nanoFramework.Graphics --version 1.0.3.4
NuGet\Install-Package nanoFramework.Graphics -Version 1.0.3.4
<PackageReference Include="nanoFramework.Graphics" Version="1.0.3.4" />
paket add nanoFramework.Graphics --version 1.0.3.4
#r "nuget: nanoFramework.Graphics, 1.0.3.4"
// Install nanoFramework.Graphics as a Cake Addin #addin nuget:?package=nanoFramework.Graphics&version=1.0.3.4 // Install nanoFramework.Graphics as a Cake Tool #tool nuget:?package=nanoFramework.Graphics&version=1.0.3.4
Welcome to the .NET nanoFramework Graphics repository
Build status
Component | Build Status | NuGet Package |
---|---|---|
nanoFramework.Graphics |
Usage
Important:
- This library is still work in progress. There may be breaking changes happening while work on this library progresses.
- So far only SPI interface has been implemented.
Check the samples for more detailed usage.
Initializing the screen
It is important to understand that the driver will be loaded when the screen routing will be initialized from the managed code. Also keep in mind that most screens are actually smaller than the size the driver is capable of handling, also that the real screen can start at a position that is not the typical origin (0,0).
You must initialize the screen before being able to create a bitmap or display anything.
This code snippet works with the ESP32 WROVER KIT pinout, in this case, the screen size matches the driver size:
const int backLightPin = 5;
const int chipSelect = 22;
const int dataCommand = 21;
const int reset = 18;
const int screenWidth = 320;
const int screenHeight = 240;
DisplayControl.Initialize(new SpiConfiguration(1, chipSelect, dataCommand, reset, backLightPin), new ScreenConfiguration(0, 0, screenWidth, screenHeight), screenBufferSize);
This code snippet is for a M5 Stick where the screen size is smaller than the driver size and starts an offset position of X=26 and Y=1 coordinate:
int backLightPin = -1; // Not managed thru ESP32 but thru AXP192
int chipSelect = 5;
int dataCommand = 23;
int reset = 18;
Configuration.SetPinFunction(4, DeviceFunction.SPI1_MISO); // 4 is unused but necessary
Configuration.SetPinFunction(15, DeviceFunction.SPI1_MOSI);
Configuration.SetPinFunction(13, DeviceFunction.SPI1_CLOCK);
DisplayControl.Initialize(new SpiConfiguration(1, chipSelect, dataCommand, reset, backLightPin), new ScreenConfiguration(26, 1, 80, 160), 10 * 1024);
Note that depending on your target, especially for ESP32, you may have to setup the pins. Even if physically not used, the MISO pin must be setup to a valid pin.
As you can see it is possible as well not to define the backlight pin. It is the same for the rest pins. Both can be set to -1. Note that in most of the cases, both are connected and needed. In the case of the M5 Stick, the backlight pin is managed thru an AXP192. If you don't switch on the backlight pin, your screen will always be black. It is important to check how this pin can be switched on.
Feedback and documentation
For documentation, providing feedback, issues and finding out how to contribute please refer to the Home repo.
Join our Discord community here.
Credits
The list of contributors to this project can be found at CONTRIBUTORS.
License
The nanoFramework Class Libraries are licensed under the MIT license.
Code of Conduct
This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behaviour in our community. For more information see the .NET Foundation Code of Conduct.
.NET Foundation
This project is supported by the .NET Foundation.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net is compatible. |
-
- nanoFramework.CoreLibrary (>= 1.12.0)
- nanoFramework.ResourceManager (>= 1.1.4)
- nanoFramework.Runtime.Events (>= 1.10.0)
- nanoFramework.Runtime.Native (>= 1.5.4)
- nanoFramework.System.Collections (>= 1.4.0)
NuGet packages (8)
Showing the top 5 NuGet packages that depend on nanoFramework.Graphics:
Package | Downloads |
---|---|
nanoFramework.M5Core2
This package includes the nanoFramework.M5Core2 assembly for .NET nanoFramework C# projects. |
|
nanoFramework.M5StickC
This package includes the nanoFramework.M5StickC assembly for .NET nanoFramework C# projects. |
|
nanoFramework.M5Core
This package includes the nanoFramework.M5Core assembly for .NET nanoFramework C# projects. |
|
nanoFramework.M5StickCPlus
This package includes the nanoFramework.M5StickCPlus assembly for .NET nanoFramework C# projects. |
|
nanoFramework.Fire
This package includes the nanoFramework.Fire assembly for .NET nanoFramework C# projects. |
GitHub repositories (2)
Showing the top 2 popular GitHub repositories that depend on nanoFramework.Graphics:
Repository | Stars |
---|---|
nanoframework/Samples
🍬 Code samples from the nanoFramework team used in testing, proof of concepts and other explorational endeavours
|
|
nanoframework/nanoFramework.IoT.Device
📦 This repo includes .NET nanoFramework implementations for various sensors, chips, displays, hats and drivers
|
Version | Downloads | Last updated |
---|---|---|
1.2.22 | 839 | 10/14/2024 |
1.2.21 | 1,117 | 9/26/2024 |
1.2.15 | 2,525 | 6/26/2024 |
1.2.10 | 1,097 | 5/13/2024 |
1.2.4 | 5,029 | 11/9/2023 |
1.2.2 | 173 | 11/9/2023 |
1.1.37 | 5,951 | 5/10/2023 |
1.1.34 | 278 | 5/5/2023 |
1.1.32 | 193 | 5/5/2023 |
1.1.30 | 187 | 5/5/2023 |
1.1.28 | 661 | 5/4/2023 |
1.1.25 | 342 | 4/18/2023 |
1.1.23 | 3,437 | 3/15/2023 |
1.1.21 | 966 | 3/10/2023 |
1.1.17 | 11,166 | 12/22/2022 |
1.1.13 | 14,312 | 10/11/2022 |
1.1.10 | 418 | 10/11/2022 |
1.1.8 | 2,068 | 10/7/2022 |
1.1.5 | 2,034 | 10/6/2022 |
1.0.3.6 | 28,480 | 7/29/2022 |
1.0.3.4 | 12,342 | 7/6/2022 |
1.0.3.2 | 25,788 | 6/2/2022 |
1.0.2 | 49,347 | 3/28/2022 |
1.0.2-preview.20 | 138 | 3/28/2022 |
1.0.2-preview.18 | 181 | 3/18/2022 |
1.0.2-preview.16 | 179 | 3/14/2022 |
1.0.2-preview.15 | 176 | 3/8/2022 |
1.0.2-preview.12 | 300 | 2/17/2022 |
1.0.2-preview.11 | 199 | 2/4/2022 |
1.0.2-preview.10 | 249 | 1/28/2022 |
1.0.2-preview.8 | 156 | 1/28/2022 |
1.0.2-preview.7 | 206 | 1/25/2022 |
1.0.2-preview.6 | 172 | 1/21/2022 |
1.0.2-preview.5 | 143 | 1/20/2022 |
1.0.2-preview.3 | 283 | 12/28/2021 |
1.0.1 | 1,224 | 12/4/2021 |
1.0.1-preview.24 | 154 | 12/4/2021 |
1.0.1-preview.22 | 157 | 12/3/2021 |
1.0.1-preview.20 | 151 | 12/3/2021 |
1.0.1-preview.18 | 152 | 12/2/2021 |
1.0.1-preview.16 | 159 | 12/2/2021 |
1.0.1-preview.14 | 153 | 12/2/2021 |
1.0.1-preview.12 | 156 | 12/1/2021 |
1.0.1-preview.11 | 158 | 12/1/2021 |
1.0.1-preview.8 | 500 | 10/22/2021 |
1.0.1-preview.7 | 224 | 10/19/2021 |
1.0.1-preview.5 | 193 | 10/17/2021 |
1.0.0 | 718 | 7/16/2021 |
1.0.0-preview.71 | 164 | 7/16/2021 |
1.0.0-preview.70 | 177 | 7/15/2021 |
1.0.0-preview.69 | 183 | 7/14/2021 |
1.0.0-preview.68 | 280 | 6/19/2021 |
1.0.0-preview.67 | 172 | 6/7/2021 |
1.0.0-preview.66 | 195 | 6/7/2021 |
1.0.0-preview.65 | 215 | 6/6/2021 |
1.0.0-preview.64 | 200 | 5/31/2021 |
1.0.0-preview.63 | 200 | 5/31/2021 |
1.0.0-preview.62 | 194 | 5/30/2021 |
1.0.0-preview.61 | 172 | 5/26/2021 |
1.0.0-preview.60 | 226 | 5/21/2021 |
1.0.0-preview.59 | 153 | 5/19/2021 |
1.0.0-preview.58 | 191 | 5/19/2021 |
1.0.0-preview.57 | 162 | 5/15/2021 |
1.0.0-preview.56 | 181 | 5/13/2021 |
1.0.0-preview.55 | 189 | 5/11/2021 |
1.0.0-preview.54 | 230 | 5/6/2021 |
1.0.0-preview.53 | 150 | 5/5/2021 |
1.0.0-preview.52 | 150 | 5/5/2021 |
1.0.0-preview.47 | 199 | 4/10/2021 |
1.0.0-preview.43 | 270 | 3/21/2021 |
1.0.0-preview.41 | 319 | 3/2/2021 |
1.0.0-preview.38 | 291 | 1/6/2021 |
1.0.0-preview.36 | 772 | 12/29/2020 |
1.0.0-preview.34 | 179 | 12/28/2020 |
1.0.0-preview.32 | 270 | 12/22/2020 |
1.0.0-preview.27 | 253 | 12/11/2020 |
1.0.0-preview.25 | 268 | 10/21/2020 |
1.0.0-preview.23 | 262 | 10/21/2020 |
1.0.0-preview.21 | 239 | 10/20/2020 |
1.0.0-preview.19 | 313 | 10/1/2020 |
1.0.0-preview.17 | 293 | 7/2/2020 |
1.0.0-preview.15 | 260 | 7/1/2020 |
1.0.0-preview.13 | 297 | 6/30/2020 |
1.0.0-preview.11 | 267 | 6/16/2020 |
1.0.0-preview.7 | 273 | 6/12/2020 |
1.0.0-preview.6 | 245 | 9/19/2020 |
1.0.0-preview.5 | 280 | 6/12/2020 |
1.0.0-preview.4 | 248 | 9/19/2020 |
1.0.0-preview.2 | 262 | 9/19/2020 |
1.0.0-preview.1 | 289 | 5/23/2020 |