For example, due to project requirements, the X axis is a timeline, which is relatively long, while the Y axis value is relatively fixed, while the zoom method provided by dynamicdatadisplay enables simultaneous scaling. I had to study the source code provided by dynamicdatadisplay.
It is not difficult to find that the coordinateutilities Source Code provides the method to scale the X axis separately. The rectextensions also provides the corresponding call, but only the zoom method is called during the zoom implementation.
1. Call zoom
Public static rect zoom (this rect, point to, double ratio)
{
Return coordinateutilities. rectzoom (rect, to, ratio );
}
Directly change to (do not need to enlarge the Y axis)
Public static rect zoom (this rect, point to, double ratio)
{
// Jia Shiyi cancels Y-axis Scaling
Return coordinateutilities. rectzoomx (rect, to, ratio );
}
The test showed that although the Y axis is no longer enlarged, the height of the image is still enlarged. Source code for further research
2. the zoom method is defined in the iviewport2dextensions interface,
So try to convert vector halfsize = new vector (visible. Width * factor/2, visible. Height * factor/2)
Change Vector halfsize = new vector (visible. Width * factor/2, visible. Height/2); // * factor Jia Shiyi cancels Y-axis Scaling
Solve the problem.
Log on to http: // 121.18.78.216/