Unofficial.WinFormAnimation 2.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package Unofficial.WinFormAnimation --version 2.0.1                
NuGet\Install-Package Unofficial.WinFormAnimation -Version 2.0.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="Unofficial.WinFormAnimation" Version="2.0.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Unofficial.WinFormAnimation --version 2.0.1                
#r "nuget: Unofficial.WinFormAnimation, 2.0.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 Unofficial.WinFormAnimation as a Cake Addin
#addin nuget:?package=Unofficial.WinFormAnimation&version=2.0.1

// Install Unofficial.WinFormAnimation as a Cake Tool
#tool nuget:?package=Unofficial.WinFormAnimation&version=2.0.1                

<img src="WinFormAnimation/Icon.png" width="42" alt="Icon"> WinForm Animation Library [.NET Framework 4.6.2+, .NET CoreApp 3.1, .NET 5 - 7]

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

A simple library for animating controls/values in .Net WinForm (.NET Framework 4.6.2+, .NET CoreApp 3.1, .NET 5 - 7). Key frame (Path) based and fully customizable.

Please note that even though this library designed for WinForm but its usage is not limited to WinForm and can be used in other environments. Only reference of the library is to 'System.Drawing' name space.

How to get

alternate text is missing from this package README image alternate text is missing from this package README image

This library is available as a NuGet package at nuget.org.

Help me fund my own Death Star

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

--OR--

You can always donate your time by contributing to the project or by introducing it to others..

Documentation

  • Float2D: A class containing two float values as Vertical and Horizontal coordinates representing a point in a 2D plane.
  • Float3D: A class containing three float values as Vertical, Horizontal and Depth coordinates representing a point in a 3D plane.
  • Path: A class containing a float starting and a float ending point for a single dimensional animation as well as duration and the function to control the animation.
  • Path2D: A class containing a Float2D starting and a Float2D ending point for a two dimensional animation as well as duration and the function to control the animation.
  • Path3D: A class containing a Float3D starting and a Float3D ending point for a three dimensional animation as well as duration and the function to control the animation.
  • Animator: A class for animating an array of Path objects. This class is one of the main classes and starting points of a basic animation.
  • Animator2D: A class for animating an array of Path2D objects. This class is one of the main classes and starting points of a basic animation.
  • Animator2D: A class for animating an array of Path3D objects. This class is one of the main classes and starting points of a basic animation.
  • SafeInvoker: A class holding a reference to a function to invoke in the correct thread, detected by a Control object passed to it. Useful for easier UI manipulations.
  • SafeInvoker<T>: Same as SafeInvoker class but with a generic argument for the function to invoke.

For full documentation of the classes and their members, please take a look at our doxygen page at falahati.github.io.

Basic examples

ONE DIMENSIONAL ANIMATION OF A PROPERTY

Following code animates a property named Value of a ProgressBar named pb_progress in 5 seconds from zero to one hundred:

new Animator(new Path(0, 100, 5000))
    .Play(pb_progress, Animator.KnownProperties.Value);

TWO DIMENSIONAL ANIMATION OF A PROPERTY

Following code animates a Form in two paths. First one moves the Form from (0, -100) to (100, 200) and second path waits for 3 seconds and then moved the Form to its initial location in 2 seconds. (this is a Form)

new Animator2D(
        new Path2D(0, 100, -100, 200, 5000).ContinueTo(this.Location.ToFloat2D(), 2000, 3000))
    .Play(this, Animator2D.KnownProperties.Location);

THREE DIMENSIONAL ANIMATION OF A PROPERTY

Following code animates a property named CustomColor of a Control named c_customLabel in 2 seconds and after a delay of 1 second using the AnimationFunctions.CubicEaseIn function and with maximum of 10 frames per second.

new Animator3D(
        new Path3D(Color.Blue.ToFloat3D(), Color.Red.ToFloat3D(), 2000, 1000, AnimationFunctions.CubicEaseIn), 
        FPSLimiterKnownValues.LimitTen)
    .Play(c_customLabel, "CustomColor");

KEYFRAMES

There are extension methods for Path, Path2D, Path3D and their arrays to let you continue the path easily and define the key frames as fast as possible. For example, following code moves a Control named c_control in a rectangular path infinitely:

new Animator2D(
    new Path2D(new Float2D(100, 100), new Float2D(200, 100), 1000)
        .ContinueTo(new Float2D(200, 200), 1000)
        .ContinueTo(new Float2D(100, 200), 1000)
        .ContinueTo(new Float2D(100, 100), 1000))
{
    Repeat = true
}.Play(c_control, Animator2D.KnownProperties.Location);

CALLBACKS

It is possible to define a custom callback as frame handler as well as defining a call back to handle the end of the animation. Following example will call a method named CustomSetMethod for setting new values and handle the frames, and starts the animation in reverse path after its end for one more time:

var animator = new Animator(new Path(100, 200, 1000).ContinueTo(400, 500));
animator.Play(new SafeInvoker<float>(CustomSetMethod), new SafeInvoker(() =>
{
    animator.Paths = animator.Paths.Select(path => path.Reverse()).Reverse().ToArray();
    animator.Play(new SafeInvoker<float>(CustomSetMethod));
}));

Demo

Check the 'WinFormAnimation.Samples' project for simple usage examples. Screenshot

License

The MIT License (MIT)

Copyright (c) 2016-2020 Soroush Falahati

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net5.0-windows7.0 is compatible.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net6.0-windows7.0 is compatible.  net7.0 was computed.  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.  net7.0-windows7.0 is compatible.  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. 
.NET Core netcoreapp3.1 is compatible. 
.NET Framework net462 is compatible.  net463 was computed.  net47 is compatible.  net471 is compatible.  net472 is compatible.  net48 is compatible.  net481 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETCoreApp 3.1

    • No dependencies.
  • .NETFramework 4.6.2

    • No dependencies.
  • .NETFramework 4.7

    • No dependencies.
  • .NETFramework 4.7.1

    • No dependencies.
  • .NETFramework 4.7.2

    • No dependencies.
  • .NETFramework 4.8

    • No dependencies.
  • .NETFramework 4.8.1

    • No dependencies.
  • net5.0-windows7.0

    • No dependencies.
  • net6.0-windows7.0

    • No dependencies.
  • net7.0-windows7.0

    • No dependencies.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Unofficial.WinFormAnimation:

Package Downloads
Krypton.Toolkit.Suite.Extended.Circular.ProgressBar.Nightly

An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package holds the circular progressbar control. This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md

Krypton.Toolkit.Suite.Extended.Circular.ProgressBar

An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package holds the circular progressbar control. This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md

Krypton.Toolkit.Suite.Extended.Circular.ProgressBar.Canary

An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. This package holds the circular progressbar control. This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6, 8 and 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on Unofficial.WinFormAnimation:

Repository Stars
Krypton-Suite/Extended-Toolkit
A companion toolkit for the standard toolkit.
Version Downloads Last updated
2.0.2 1,009 11/16/2023
2.0.1 870 2/18/2023
2.0.0 1,497 1/1/2023