BitmapPainter 1.1.2.5

The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package BitmapPainter --version 1.1.2.5
                    
NuGet\Install-Package BitmapPainter -Version 1.1.2.5
                    
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="BitmapPainter" Version="1.1.2.5" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BitmapPainter" Version="1.1.2.5" />
                    
Directory.Packages.props
<PackageReference Include="BitmapPainter" />
                    
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 BitmapPainter --version 1.1.2.5
                    
#r "nuget: BitmapPainter, 1.1.2.5"
                    
#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 BitmapPainter@1.1.2.5
                    
#: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=BitmapPainter&version=1.1.2.5
                    
Install as a Cake Addin
#tool nuget:?package=BitmapPainter&version=1.1.2.5
                    
Install as a Cake Tool

BitmapPainter

Nuget

A simple way to paint a Bitmap and update the User Interface Extremely Fast

Example

using System;
using System.Drawing;
using System.Threading.Tasks;

public class MainContext : NotifyPropertyChanged, IDisposable
{
    private bool tick;

    private readonly int Width = 1000;
    private readonly int Height = 1000;

    private readonly BitmapPainter BitmapPainter;

    private static readonly Brush Red = new SolidBrush(Color.Red);
    private static readonly Brush Yellow = new SolidBrush(Color.FromArgb(100, 250, 208, 0));

    public MainContext()
    {
        BitmapPainter = new(NextModification, Width, Height, NextInterfaceUpdate);

        uint delayMs = 15;

        Task.Run(() =>
        {
            BitmapPainter.StartPainting(delayMs);
        }).ConfigureAwait(false);
    }

    public bool NextModification(Graphics g)
    {
        bool updateUI;

        if (!tick)
        {
            tick = true;

            g.FillRectangle(Yellow, new Rectangle(0, 0, Width, Height));

            updateUI = true;
        }
        else
        {
            tick = false;

            g.FillRectangle(Red, new Rectangle(0, 0, Width, Height));

            updateUI = true;
        }

        return updateUI;
    }

    public void NextInterfaceUpdate()
    {
        UI.Invoke(() =>
        {
            SomeVM.Image = BitmapPainter.CreateBitmapSource();
        });
    }

    public void Dispose()
    {
        BitmapPainter.Dispose();

        GC.SuppressFinalize(this);
    }
}

Auto Upgrade Resolution

Automatically adjusts the resolution of the delay to the highest available at the interval for the lifetime of the application

BitmapPainter.StartLifeTimeUpgradeService.StartLifeTimeUpgradeService(uint delay)

You only need to run this once, running it more than once will do nothing.

Attempt Upgrade Resolution Once

BitmapPainter.TryUpgradeOnce();
Product Compatible and additional computed target framework versions.
.NET Framework net48 is compatible.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
Loading failed

Initial releases