We are currently using the Zoom functionality on the PlotCube that uses the mousewheel to zoom in and out of a 2-D image plot (TwoDMode=true). We also use the zoom obtained through the zoom selection rectangle functionality, again provided by ILNumerics library. The problem is that when we magnify/zoom a 2D image enough using the mouse wheel, white patches start to appear on the image (I think this is something to do with the view clipping pane). This does not happen when we zoom in by a large ammount using the zoom selection rectangle functionality.
Is there a fix for this problem? or do we have to implement the mousewheel zoom ourselves (by catching the mousewheel events and changing the limits accordingly).
Here is some sample code, pop it into a basic application (Windows Forms or WPF). The ILPanel instance should be called iLPanel and dock it to the entire main or parent window contents. Call the method "IlPanelOnLoad()" during the window "loaded" event.
private void IlPanelOnLoad()
{
ilPanel.Scene = PlotImageTest();
var pc = ilPanel.Scene.First<ILPlotCube>();
pc.DataScreenRect = new RectangleF(0.15f, 0.10f, 0.80f, 0.70f);
ilPanel.Scene.Configure();
ilPanel.Refresh();
}
private ILScene PlotImageTest()
{
var scene = new ILScene();
// the data to show comes from a predefined
// example dataset contained in ILNumerics
ILArray<float> A = ILMath.tosingle(ILSpecialData.terrain["0:240;0:240"]);
// we fetch to min and max values for tight limits
float min, max;
A.GetLimits(out min, out max);
// Create the surface
ILSurface surface = new ILSurface(A);
surface.Wireframe.Visible = false; // for fast rendering
surface.Markable = false;
// scene setup: add a plotcube in 2D mode...
var plotCube = scene.Add(new ILPlotCube(twoDMode: true) {
// add a surface to the plot cube
Children = {
surface
},
// configure the datascreen rect. This makes the plotcube
// content fill the whole panel area
DataScreenRect = new RectangleF(0.13f, 0.13f, 0.74f, 0.74f),
// configure the plot cube limits to show no margins
Limits = {
XMin = 0, YMin = 0, ZMin = min,
XMax = A.S[1] - 1, YMax = A.S[0] - 1, ZMax = max + 1
}
});
return scene;
}