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

28
LINES

< > BotCompany Repo | #1027023 - Fullscreen Image

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Uses 843K of libraries. Click here for Pure Java version (6794L/36K).

!7

cmodule FullscreenImage > DynImageSurface {
  switchable bool noScroll; // workaround for weird unnecessary scrollbars (TODO: find out why that happens)
  switchable bool zoomToScreen = true;
  transient ImageSurface fullScreenIS;
  
  start {
    if (!hasImage()) setImage(whiteImage(100, 100));
  }
  
  visual
    withCenteredButtons(super, "Show fullscreen", rThread showFullscreen);
    
  void showFullscreen enter {
    if (!hasImage()) ret;
    if (fullScreenIS != null) activateFrame(fullScreenIS);
    fullScreenIS = noScroll
      ? showFullScreenImageSurface_noScroll(getImage())
      : showFullScreenImageSurface(getImage());
    if (zoomToScreen) fullScreenIS.zoomToWindow();
    onFrameClose(fullScreenIS, r { fullScreenIS = null; });
  }
  
  void exitFullscreen enter {
    disposeFrame(fullScreenIS);
  }
}

download  show line numbers  debug dex   

Travelled to 5 computer(s): bhatertpkbcr, mqqgnosmbjvj, pzhvpgtvlbxg, tvejysmllsmz, xrpafgyirdlv

No comments. add comment

Snippet ID: #1027023
Snippet name: Fullscreen Image
Eternal ID of this version: #1027023/5
Text MD5: 8921966c5e01b74c088b60abe8c08e5f
Transpilation MD5: 83548910b82b7cb0373ac536cd26b8f6
Author: stefan
Category: javax / gui
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-02-10 18:41:32
Source code size: 856 bytes / 28 lines
Pitched / IR pitched: No / No
Views / Downloads: 38 / 450
Version history: 4 change(s)
Referenced in: #1027028

Formerly at http://tinybrain.de/1027023 & http://1027023.tinybrain.de