private IImageFunction getImageFunction(IRayScene sc, int width, int height) { IImageFunction imf = FormSupport.getImageFunction(sc); imf.Width = width; imf.Height = height; RayTracing rt = imf as RayTracing; if (rt != null) { rt.DoShadows = checkShadows.Checked; rt.DoReflections = checkReflections.Checked; rt.DoRefractions = checkRefractions.Checked; } return(imf); }