Method Zoom
- Namespace
- VectorDraw.Professional.ActionUtilities
- Assembly
- VectorDraw.Professional.dll
Zoom(object, object, object)
Performs a zoom operation on the active layout with customizable type and optional corner parameters.
public void Zoom(object Type, object FirstCorner, object OtherCorner)
Parameters
TypeobjectThe zoom type as a string. Common values include:
- "e" or "extents" — Zoom to extents.
- "a" or "all" — Zoom to all with limits.
- "p" or "previous" — Restore previous zoom.
- "s" or "scale" — Scale zoom (requires scale factor in FirstCorner).
- "w" or "window" — Window zoom (requires two corner points).
- "o" or "object" — Zoom to selected object (requires an object).
- "sel" or "selection" — Zoom to selection (requires a selection of objects).
FirstCornerobjectFirst parameter; meaning depends on zoom type. For scale zoom, pass the scale factor (e.g., 1.2 for 120%). For window zoom, pass the first corner gPoint. For other types, pass
nullor "USER".OtherCornerobjectSecond parameter; for window zoom, pass the opposite corner gPoint. For other zoom types, pass
nullor "USER".
Remarks
This is the core method that performs the actual zoom operation. All other zoom methods delegate to this method. The zoom type parameter is case-insensitive.
The method raises the usual document action events (for example ActionStart and ActionEnd).
Example — zoom by scale factor:
doc.CommandAction.Zoom("scale", 1.5d, null); // Zoom in to 150%
Example — window zoom:
var corner1 = new gPoint(10, 10, 0);
var corner2 = new gPoint(50, 50, 0);
doc.CommandAction.Zoom("window", corner1, corner2); // Zoom to rectangular region