CanvasZoomPanDragLib 2.0.0

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

// Install CanvasZoomPanDragLib as a Cake Tool
#tool nuget:?package=CanvasZoomPanDragLib&version=2.0.0

In Xaml: <cvLib:BorderZoomPanDrag Grid.Row="1" BorderThickness="1" BorderBrush="Black" ClipToBounds="True"> <Canvas Background="White" Width="350" Height="350" x:Name="cv" > </Canvas> </cvLib:BorderZoomPanDrag>

In Code-behind:

  • Init canvas manager:

    CanvasManager canvasManager = new CanvasManager(cv, new Point3D(), new Point3D(10000, 10000, 0));

  • Init drawing (Drawing/SelectableDrawing/DraggableDrawing):

    Selectable sel = new Selectable(new List<Point3D> { new Point3D(0, 0, 0) }, canvasManager);

    class Selectable : SelectableDrawingBase { public Selectable(IList<Point3D> pDecart, CanvasManager canvasManager) : base(pDecart, canvasManager) { }

    protected override List<Shape> CreateShapesOnCanvas()
    {
    	var shapes = new List<Shape>();
    	var el = new Ellipse();
    	var pCanvas = BasePointsCanvas[0];
    	Canvas.SetLeft(el, pCanvas.X - 10 / 2);
    	Canvas.SetTop(el, pCanvas.Y - 10 / 2);
    	el.Height = 10;
    	el.Width = 10;
    	el.Fill = COLOR_DEFAULT;
    	shapes.Add(el);
    	return shapes;
    }
    

    }

  • Draw:

    canvasManager.Add(sel);

Demo: https://github.com/thesung26/CanvasZoomPanDrag/tree/main/DemoDotnetFramework

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.
  • .NETFramework 4.8

    • 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
2.0.1 102 4/14/2024
2.0.0 77 4/10/2024
1.0.1 101 4/7/2024
1.0.0 80 4/7/2024

Release for testing