The roll function in the CADCamera class allows users to rotate the camera around it's "forward" axis.
The CADViewer sample demonstrates this functionality. See Samples.
The following Roll sample illustrates how you use the roll function:
C# |
Copy Code |
using System.IO;
using ImageGear.Formats;
using ImageGear.Formats.CAD;
public static void CameraRoll(string path, double angle)
{
ImGearCADPage page = null;
// Load the file.
using (FileStream fileStream = new FileStream(path, FileMode.Open, FileAccess.Read))
{
page = (ImGearCADPage)ImGearFileFormats.LoadPage(fileStream);
}
// Roll the camera
page.Camera.Roll(angle);
} |
VB.NET |
Copy Code |
Imports System.IO
Imports ImageGear.Formats
Imports ImageGear.Formats.CAD
Public Sub CameraRoll(path As String, angle As Double)
Dim page As ImGearCADPage
' Load the file.
Using fileStream As New FileStream(path, FileMode.Open, FileAccess.Read)
page = ImGearFileFormats.LoadPage(fileStream)
End Using
' Roll the camera
page.Camera.Roll(angle)
End Sub |
The roll function can also be called without providing a position. This will cause the image to roll around the forward axis at the center point of the view.