[]
        
(Showing Draft Content)

C1Zoom Behavior Snap Points

A rough result can occur when you set the zoom factor by touch to values such as 197% or 202% rather than a number like 200% . The SnapPoints feature helps the zoomfactor stop at a good number like 200%. SnapPoints has a group of stop values for the zoom factor, and it has the minimum distance that can cause the current zoom factor snap to a zoom factor in the group.

The c1Zoom.ZoomSnapPoints can be set like the following in code:

using C1.Win.C1TouchToolKit;
 
private void Form1_Load(object sender, EventArgs e)
{
    c1Zoom1.ZoomPreviewMode = ZoomPreviewMode.AlternativeContent;
 
    c1Zoom1.MaxZoomFactor = 4.0f;
    c1Zoom1.ZoomSnapDistance = 0.05f;
    c1Zoom1.ZoomSnapPoints.Add(2.0f);
    c1Zoom1.ZoomSnapPoints.Add(3.0f);
}
 
private void c1Zoom1_ZoomFactorChanged(object sender, EventArgs e)
{
    this.Text = string.Format("{0:P}", c1Zoom1.ZoomFactor);
}
 
Imports C1.Win.C1TouchToolKit
 
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
    C1Zoom1.ZoomPreviewMode = ZoomPreviewMode.AlternativeContent
 
    C1Zoom1.MaxZoomFactor = 4.0F
    C1Zoom1.ZoomSnapDistance = 0.05F
    C1Zoom1.ZoomSnapPoints.Add(2.0F)
    C1Zoom1.ZoomSnapPoints.Add(3.0F)
End Sub
 
Private Sub C1Zoom1_ZoomFactorChanged(sender As System.Object, e As System.EventArgs) Handles C1Zoom1.ZoomFactorChanged
    Me.Text = String.Format("{0:P}", C1Zoom1.ZoomFactor)
End Sub