ImageGear .NET - Updated May 1, 2018
Zoom
User Guide > How to Work with... > CAD > How To ... > Manipulate View Using a Camera > Zoom

The zoom function in the CADCamera class allows users to zoom and set ViewRect size to the given dimensions.

The CADViewer sample demonstrates this functionality. See Samples.

The following Zoom sample illustrates how you use the zoom function:

C#
Copy Code
using System.IO;
using ImageGear.Formats;
using ImageGear.Formats.CAD;

public static void CameraZoom(string path, double amount)
{
    ImGearCADPage page = null;

    // Load the file.
    using (FileStream fileStream = new FileStream(path, FileMode.Open, FileAccess.Read))
    {
        page = (ImGearCADPage)ImGearFileFormats.LoadPage(fileStream);
    }

    // Zoom the camera
    page.Camera.Zoom(amount);
}

The following ZoomExtents sample illustrates how you use the zoomExtents function to zoom to certain view dimensions:

C#
Copy Code
using System.IO;
using ImageGear.Formats;
using ImageGear.Formats.CAD;

public static void CameraZoomExtents(string path, int width, int height)
{
    ImGearCADPage page = null;

    // Load the file.
    using (FileStream fileStream = new FileStream(path, FileMode.Open, FileAccess.Read))
    {
        page = (ImGearCADPage)ImGearFileFormats.LoadPage(fileStream);
    }

    // Zoom the camera
    page.Camera.ZoomExtents(width, height);
}