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

8
LINES

< > BotCompany Repo | #1004614 // subtitle - add UTF code to image

JavaX fragment (include)

static BWImage subtitle(BWImage img, S text) {
  BWImage img2 = utfToImage(text);
  int w = max(img.getWidth(), img2.getWidth()), h = img.getHeight() + img2.getHeight();
  BWImage img3 = new BWImage(w, h, 1f);
  copyBWImage(img, 0, 0, img3, (w-img.getWidth())/2, 0);
  copyBWImage(img2, 0, 0, img3, (w-img2.getWidth())/2, img.getHeight());
  ret img3;
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1004614
Snippet name: subtitle - add UTF code to image
Eternal ID of this version: #1004614/1
Text MD5: 7e8ff966b857bbe5a58a9cd4f69b4aa3
Author: stefan
Category: javax / images
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-08-23 23:39:32
Source code size: 360 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 475 / 484
Referenced in: [show references]