sclass HGridFinderGUI { BufferedImage img; ImageSurface is; JSlider slider; int ww = 10; *(BufferedImage *img) {} void show { is = showImage(img); slider = jliveSlider(1, 50, ww, voidfunc(Int value) { ww = value; split(); }); addToWindowWithMargin(is, sliderWithValueLabel(slider)); split(); } void split { new L rects; int w = img.getWidth(); for (int x = 0; x < w; x += ww) rects.add(new Rect(x, 0, min(ww, w-x), img.getHeight())); is.setImage(mergeImagePartsHorizontally(new RGBImage(img), rects)); } }