Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

26
LINES

< > BotCompany Repo | #1015501 // VGridFinderGUI

JavaX fragment (include)

1  
sclass VGridFinderGUI {
2  
  BufferedImage img;
3  
  ImageSurface is;
4  
  JSlider slider;
5  
  int ww = 10;
6  
  
7  
  *(BufferedImage *img) {}
8  
9  
  void show {
10  
    is = showImage(img);
11  
    slider = jverticalLiveSlider(1, 50, ww, voidfunc(Int value) {
12  
      ww = value;
13  
      split();
14  
    });
15  
    addToWindowRight(is, withMargin(sliderWithValueLabel(slider)));
16  
    split();
17  
  }
18  
  
19  
  void split {
20  
    new L<Rect> rects;
21  
    int w = img.getWidth(), h = img.getHeight();
22  
    for (int y = 0; y < h; y += ww)
23  
      rects.add(new Rect(0, y, w, min(ww, h-y)));
24  
    is.setImage(mergeImagePartsVertically(new RGBImage(img), rects));
25  
  }
26  
}

Author comment

Began life as a copy of #1015499

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1015501
Snippet name: VGridFinderGUI
Eternal ID of this version: #1015501/2
Text MD5: 30941bbc3feba848dcb21ca2844e3ec3
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-05-15 03:24:31
Source code size: 637 bytes / 26 lines
Pitched / IR pitched: No / No
Views / Downloads: 347 / 919
Version history: 1 change(s)
Referenced in: [show references]