diff --git a/.github/workflows/develop-ci.yml b/.github/workflows/develop-ci.yml index 24e1a92b50..d75a2ba0c8 100644 --- a/.github/workflows/develop-ci.yml +++ b/.github/workflows/develop-ci.yml @@ -63,7 +63,7 @@ jobs: uses: actions/setup-dotnet@v1 with: dotnet-version: - 7.0.x + 8.0.x - name: Build Meadow Foundation run: dotnet build -c Release Meadow.Foundation/Source/Meadow.Foundation.sln diff --git a/.github/workflows/main-ci.yml b/.github/workflows/main-ci.yml index 01a7f17468..30a0fd6344 100644 --- a/.github/workflows/main-ci.yml +++ b/.github/workflows/main-ci.yml @@ -23,7 +23,7 @@ jobs: uses: actions/setup-dotnet@v1 with: dotnet-version: - 7.0.x + 8.0.x - name: Build Meadow Foundation run: dotnet build -c Release Meadow.Foundation/Source/Meadow.Foundation.sln diff --git a/Source/Meadow.Foundation.Peripherals/Displays.WinForms/Samples/WinForms_Sample/MeadowApp.cs b/Source/Meadow.Foundation.Peripherals/Displays.WinForms/Samples/WinForms_Sample/MeadowApp.cs new file mode 100644 index 0000000000..c4de8ea0f8 --- /dev/null +++ b/Source/Meadow.Foundation.Peripherals/Displays.WinForms/Samples/WinForms_Sample/MeadowApp.cs @@ -0,0 +1,59 @@ +using Meadow; +using Meadow.Foundation.Displays; +using Meadow.Foundation.Graphics; +using System.Windows.Forms; + +namespace WinForms_Sample; + +// + +public class MeadowApp : App +{ + WinFormsDisplay? _display; + MicroGraphics _graphics = default!; + + public override Task Initialize() + { + _display = new WinFormsDisplay(240, 320); + + _graphics = new MicroGraphics(_display) + { + CurrentFont = new Font12x20(), + Stroke = 1 + }; + + _ = Task.Run(() => + { + Thread.Sleep(2000); + + _graphics.Clear(); + + _graphics.DrawTriangle(10, 30, 50, 50, 10, 50, Color.Red); + _graphics.DrawRectangle(20, 45, 40, 20, Color.Yellow, false); + _graphics.DrawCircle(50, 50, 40, Color.Blue, false); + _graphics.DrawText(5, 5, "Meadow F7", Color.White); + + _graphics.Show(); + }); + + return Task.CompletedTask; + } + + public override Task Run() + { + Application.Run(_display!); + + return Task.CompletedTask; + } + + public static async Task Main(string[] args) + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + ApplicationConfiguration.Initialize(); + + await MeadowOS.Start(args); + } +} + +// \ No newline at end of file diff --git a/Source/Meadow.Foundation.Peripherals/Displays.WinForms/Samples/WinForms_Sample/WinForms_Sample.csproj b/Source/Meadow.Foundation.Peripherals/Displays.WinForms/Samples/WinForms_Sample/WinForms_Sample.csproj new file mode 100644 index 0000000000..0255f024c0 --- /dev/null +++ b/Source/Meadow.Foundation.Peripherals/Displays.WinForms/Samples/WinForms_Sample/WinForms_Sample.csproj @@ -0,0 +1,13 @@ + + + Exe + net8.0-windows + enable + enable + 10.0 + + + + + + \ No newline at end of file diff --git a/Source/Meadow.Foundation.sln b/Source/Meadow.Foundation.sln index 0632e4c21c..97713f013e 100644 --- a/Source/Meadow.Foundation.sln +++ b/Source/Meadow.Foundation.sln @@ -1445,6 +1445,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Amg8833_Sample", "Meadow.Fo EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Displays.AsciiConsole", "Meadow.Foundation.Peripherals\Displays.AsciiConsole\Driver\Displays.AsciiConsole.csproj", "{27589062-708E-44CD-9DF4-0D16899265FE}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{80EC3729-DB91-4F94-B11D-B611A214BA31}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WinForms_Sample", "Meadow.Foundation.Peripherals\Displays.WinForms\Samples\WinForms_Sample\WinForms_Sample.csproj", "{A5734B07-64C0-4C93-9EB0-390B0B6A075C}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -3493,6 +3497,10 @@ Global {27589062-708E-44CD-9DF4-0D16899265FE}.Release|Any CPU.ActiveCfg = Release|Any CPU {27589062-708E-44CD-9DF4-0D16899265FE}.Release|Any CPU.Build.0 = Release|Any CPU {27589062-708E-44CD-9DF4-0D16899265FE}.Release|Any CPU.Deploy.0 = Release|Any CPU + {A5734B07-64C0-4C93-9EB0-390B0B6A075C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A5734B07-64C0-4C93-9EB0-390B0B6A075C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A5734B07-64C0-4C93-9EB0-390B0B6A075C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A5734B07-64C0-4C93-9EB0-390B0B6A075C}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -4214,6 +4222,8 @@ Global {2F20AD5B-5879-432B-B44F-8540DAEE5C43} = {40687DAC-F3EF-4F70-850A-0429B9586648} {866EA918-39E3-4440-877C-70A3205A3D00} = {E608C8E7-1B76-4859-9AF9-C868B5C61994} {27589062-708E-44CD-9DF4-0D16899265FE} = {E775FF9F-8AC5-4994-B45A-20B50E2B03E2} + {80EC3729-DB91-4F94-B11D-B611A214BA31} = {BBF136B7-361C-4FC2-AACA-6B6ED79BDCF1} + {A5734B07-64C0-4C93-9EB0-390B0B6A075C} = {80EC3729-DB91-4F94-B11D-B611A214BA31} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {AF7CA16F-8C38-4546-87A2-5DAAF58A1520}