1 | static BWImage subtitle(BWImage img, S text) { |
2 | BWImage img2 = utfToImage(text); |
3 | int w = max(img.getWidth(), img2.getWidth()), h = img.getHeight() + img2.getHeight(); |
4 | BWImage img3 = new BWImage(w, h, 1f); |
5 | copyBWImage(img, 0, 0, img3, (w-img.getWidth())/2, 0); |
6 | copyBWImage(img2, 0, 0, img3, (w-img2.getWidth())/2, img.getHeight()); |
7 | ret img3; |
8 | } |
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: | 564 / 581 |
Referenced in: | [show references] |