Atitit 动态按钮图片背景颜色与文字组合解决方案
2016-11-18 00:40
288 查看
Atitit 动态按钮图片背景颜色与文字组合解决方案
转换背景颜色,setFont("cywe_img", fontScale, 50, 5)
设置文字大小与坐标
文字分拆,使用字根组合,也就256个字根就够了。
public static void main(String[] args) throws FileNotFoundException {
long startTime = System.currentTimeMillis(); // 获取开始时间
String out = "C:\\0workspace\\AtiPlatf_cms\\WebRoot\\btn\\" + filex.getUUidName() + ".png";
double fontScale = 0.6;
new SvsBtnFilter().setBg("bush_blu", 300, 60, "210,0.1,0.1").setFont("cywe_img", fontScale, 50, 5).setFont("din_img", fontScale, 90, 5).toOutStream(new FileOutputStream(new File(out)));
System.out.println("--f");
long endTime = System.currentTimeMillis(); // 获取结束时间
System.out.println("程序运行时间: " + (endTime - startTime) + "ms");
System.out.println("--0f");
}
/AtiPlatf_cms/src/com/attilax/img/SvsBtnFilter.java
Builder<BufferedImage> bldr = Thumbnails.of(bg);
Builder<BufferedImage> bldr = Thumbnails.of(bg);
//of(new File(this.bg));
for (AFont aFont : li) {
Runnable c = () -> {
BufferedImage img1 = imgx.toImg(aFont.fontPic);
try {
img1 = Thumbnails.of(img1).scale(aFont.fontScale).asBufferedImage();
Coordinate coordinate1 = new Coordinate(aFont.point.x, aFont.point.y);
bldr.watermark(coordinate1, img1, 1f);
} catch (IOException e) {
System.out.println("----wan::" + e.getMessage() + aFont);
e.printStackTrace();
}
};
c.run();
// urlPool.execute(c);
}
try {
bldr.size(300, 60).keepAspectRatio(true).outputFormat("png").toOutputStream(fileOutputStream);
} catch (IOException e1) {
ExUtil.throwExV2(e1);
}
作者:: 绰号:老哇的爪子 ( 全名::Attilax Akbar Al Rapanui 阿提拉克斯 阿克巴 阿尔 拉帕努伊 )
汉字名:艾提拉(艾龙), EMAIL:1466519819@qq.com
转载请注明来源: http://www.cnblogs.com/attilax/
Atiend
转换背景颜色,setFont("cywe_img", fontScale, 50, 5)
设置文字大小与坐标
文字分拆,使用字根组合,也就256个字根就够了。
public static void main(String[] args) throws FileNotFoundException {
long startTime = System.currentTimeMillis(); // 获取开始时间
String out = "C:\\0workspace\\AtiPlatf_cms\\WebRoot\\btn\\" + filex.getUUidName() + ".png";
double fontScale = 0.6;
new SvsBtnFilter().setBg("bush_blu", 300, 60, "210,0.1,0.1").setFont("cywe_img", fontScale, 50, 5).setFont("din_img", fontScale, 90, 5).toOutStream(new FileOutputStream(new File(out)));
System.out.println("--f");
long endTime = System.currentTimeMillis(); // 获取结束时间
System.out.println("程序运行时间: " + (endTime - startTime) + "ms");
System.out.println("--0f");
}
/AtiPlatf_cms/src/com/attilax/img/SvsBtnFilter.java
Builder<BufferedImage> bldr = Thumbnails.of(bg);
Builder<BufferedImage> bldr = Thumbnails.of(bg);
//of(new File(this.bg));
for (AFont aFont : li) {
Runnable c = () -> {
BufferedImage img1 = imgx.toImg(aFont.fontPic);
try {
img1 = Thumbnails.of(img1).scale(aFont.fontScale).asBufferedImage();
Coordinate coordinate1 = new Coordinate(aFont.point.x, aFont.point.y);
bldr.watermark(coordinate1, img1, 1f);
} catch (IOException e) {
System.out.println("----wan::" + e.getMessage() + aFont);
e.printStackTrace();
}
};
c.run();
// urlPool.execute(c);
}
try {
bldr.size(300, 60).keepAspectRatio(true).outputFormat("png").toOutputStream(fileOutputStream);
} catch (IOException e1) {
ExUtil.throwExV2(e1);
}
作者:: 绰号:老哇的爪子 ( 全名::Attilax Akbar Al Rapanui 阿提拉克斯 阿克巴 阿尔 拉帕努伊 )
汉字名:艾提拉(艾龙), EMAIL:1466519819@qq.com
转载请注明来源: http://www.cnblogs.com/attilax/
Atiend
相关文章推荐
- Atitit 动态按钮图片背景颜色与文字组合解决方案
- IOS设置导航栏全局的背景图片、导航栏title文字颜色大小、导航栏左右按钮的颜色。
- 动态生成文字图片解决方案
- Unity 3D 用图片作背景按钮文字被遮盖的问题
- 如何使带背景图片的Button按钮中的文字居中偏上显示
- android Button 切换背景,实现动态按钮和按钮颜色渐变
- VC改变对话框按钮字体颜色和背景的解决方案(转)
- 用css样式定义圆角背景图片按钮根据文字自适应宽度的方法
- ios设置导航栏背景图片、返回按钮背景、标题颜色等等
- c# winform 为按钮动态背景图片
- c#WINFORM中如何为动态生成的按钮加背景图片
- 分享c#动态生成文字图片解决方案
- 动态生成文字图片解决方案
- 分享动态生成文字图片解决方案
- 分享C#动态生成文字图片解决方案
- android Button 切换背景,实现动态按钮和按钮颜色渐变
- UIbutton 按钮加图片后文字显示不出来解决方案
- 关于在IE下打印页面背景图片和背景颜色丢失的解决方案
- 分享动态生成文字图片解决方案
- 关于文字颜色/图片背景---selector状态列表