api2doc / onbon.bx05.api Goto Github PK
View Code? Open in Web Editor NEWOnbon BX05 API for Java & Android
Onbon BX05 API for Java & Android
如题
我设置了文本不换行( page.setLineBreak(false),在led上显示的时候依然换行
Bx5GEnv.initial("log.properties", 30000);
Bx5GScreenClient screen = new Bx5GScreenClient("MyScreen");
for (String ip : program.getTerminals()) {
ScreenStatus res=new ScreenStatus();
res.setIp(ip);
if (!screen.connect(ip, 5005)) {
res.setStatus("fail");
res.setMessage("connect failed.");
reslist.add(res);
continue;
}
Bx5GScreenProfile profile = screen.getProfile();
DisplayStyle[] styles = DisplayStyleFactory.getStyles().toArray(new DisplayStyle[0]);
ProgramBxFile p000 = new ProgramBxFile("P000", profile);
// 是否显示节目边框
p000.setFrameShow(false);
p000.setupStartEndDate(program.getStartdate(), program.getEnddate());
if(program.getStarttime()!=null&&program.getEndtime()!=null){
String format="hh:mm:ss";
Date startTime=LEDUtil.ConvertStrToDate(program.getStarttime(),format);
Date endTime=LEDUtil.ConvertStrToDate(program.getEndtime(),format);
p000.addPlayPeriodSetting(startTime.getHours(), startTime.getMinutes(), startTime.getSeconds(), endTime.getHours(), endTime.getMinutes(), endTime.getSeconds());
}
TextCaptionBxArea tArea = new TextCaptionBxArea(2, 2, profile.getWidth()-3, profile.getHeight()-3, screen.getProfile());
// 使能区域边框
tArea.setFrameShow(false);
// 创建一个数据页,并希望显示 “P009” 这几个文字
TextBxPage page = new TextBxPage(LEDUtil.getShowText(program.getTexts(),program.getSpaces()));
// 对文本的处理是否自动换行
page.setLineBreak(false);
// 设置文本水平对齐方式
page.setHorizontalAlignment(TextBinary.Alignment.NEAR);
// 设置文本垂直居中方式
page.setVerticalAlignment(TextBinary.Alignment.CENTER);
// 设置文本字体
page.setFont(new Font(program.getFamily(), Font.PLAIN, program.getSize())); // 字体
// 设置文本颜色
page.setForeground(new Color(program.getColor()[0],program.getColor()[1],program.getColor()[2]));
// 设置区域背景色,默认为黑色
page.setBackground(new Color(program.getBgcolor()[0],program.getBgcolor()[1],program.getBgcolor()[2],program.getAlpha()));
// 调整特技方式
page.setDisplayStyle(styles[program.getEffect()]);
// 调整特技速度
page.setSpeed(program.getSpeed());
//
page.setHeadTailInterval(0);
// 调整停留时间, 单位 10ms
page.setStayTime(program.getDuration());
// 将前面创建的 page 添加到 area 中
tArea.addPage(page);
p000.addArea(tArea);
ArrayList plist1 = new ArrayList();
plist1.add(p000);
screen.writePrograms(plist1);
screen.disconnect();
很高兴看到你的分享demo,现有一问题想向您请教:该demo示例是否支持发送图片?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.