Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Codenameone 向代号为1的图像添加重复的文本水印_Codenameone - Fatal编程技术网

Codenameone 向代号为1的图像添加重复的文本水印

Codenameone 向代号为1的图像添加重复的文本水印,codenameone,Codenameone,是否可以使用代码名One API将重复文本作为水印添加到图像中 例如,给出一个图像和一个或多个单词的文本,我想创建一个新图像,如下所示: 当然,只需使用可变图像即可: Image watered = Image.create(sourceImg.getWidth(), sourceImg.getHeight()); Graphics g = watered.getGraphics(); g.drawImage(sourceImg, 0, 0); g.setAlpha(30); g.setColo

是否可以使用代码名One API将重复文本作为水印添加到图像中

例如,给出一个图像和一个或多个单词的文本,我想创建一个新图像,如下所示:


当然,只需使用可变图像即可:

Image watered = Image.create(sourceImg.getWidth(), sourceImg.getHeight());
Graphics g = watered.getGraphics();
g.drawImage(sourceImg, 0, 0);
g.setAlpha(30);
g.setColor(0xcccccc);
g.rotate(Math.PI / 2, sourceImg.getWidth() / 2, sourceImg.getHeight() / 2);


// here you can loop and do draw String a lot and just move with string width/height

// or you can use multiple drawImage calls and have a ready made watermark
// this might actually look better and won't require the alpha/rotation code