📄 image_service.he
字号:
class
{
void startWidget()
{
setMinimizedView(createMinimizedView("viewMini", getStyle("default")));
}
Shell openWidget()
{
fetch();
return null;
}
void fetch()
{
int x, int y = getScreenSize();
Value arg = [
"url" => "http://dev.widsets.com/images/widsets_dev_logo.gif",
"boundx" => x - 40,
"boundy" => y - 40,
"format" => "png8"
];
call(null, "imageService", "geturl", arg, ok, nok);
}
void ok(Object state, Value ret)
{
Image img = getImage(ByteArray(ret));
//bubble is the easiest way to show images, normally
//one would instantiate new Picture component and
//place the Image inside it and then place the Picture
//component in a flow
setBubble(img, "Success");
}
void nok(Object state, String error)
{
setBubble(null, "Error getting image: "+error);
}
} //class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -