Uses 911K of libraries. Click here for Pure Java version (9498L/51K).
!7 cmodule ChooseBackgroundImage > DynImageSurface { start { set useUpdateHack; setImage(dm_loadBackgroundImage()); } visualize { ret withCenteredButtons(super.visualize(), "Load image...", rThread { selectFile("Background Image (JPG/PNG)", voidfunc(File f) { setImage(loadImage2(f)); }); }, "Use as background image", r { File f = putImageInDirectory_jpeg(getImage(), stefansOS_backgroundDir()); saveTextFile(stefansOS_backgroundFile(), f2s(f)); set(dm_os(), background := fileToURI(f)); updateImage(); }, "Restore default image", r { deleteFile(stefansOS_backgroundFile()); set(dm_os(), background := dm_getOS('defaultBackground)); updateImage(); }); } void updateImage { infoBox("Background image changed!"); set(dm_desktopPane(), image := dm_loadBackgroundImage()); dm_desktopPane().repaint(); } }
Began life as a copy of #1016607
download show line numbers debug dex old transpilations
Travelled to 12 computer(s): bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1019434 |
Snippet name: | Choose Background Image [for Stefan's OS] |
Eternal ID of this version: | #1019434/12 |
Text MD5: | 72466cbc239ab8a564f5f2f6adb0a1a3 |
Transpilation MD5: | 5561b440717b71d9c982310c0057e7b5 |
Author: | stefan |
Category: | javax / html |
Type: | JavaX source code (Dynamic Module) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-11-08 21:32:01 |
Source code size: | 1011 bytes / 36 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 408 / 15341 |
Version history: | 11 change(s) |
Referenced in: | [show references] |