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

26
LINES

< > BotCompany Repo | #1015499 // HGridFinderGUI

JavaX fragment (include)

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<Rect> 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));
  }
}

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: #1015499
Snippet name: HGridFinderGUI
Eternal ID of this version: #1015499/2
Text MD5: 801dc90f9340344238c5d2e9cef27710
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:19:12
Source code size: 617 bytes / 26 lines
Pitched / IR pitched: No / No
Views / Downloads: 272 / 830
Version history: 1 change(s)
Referenced in: [show references]