Google apps script 如何在GAS UI中显示位于google drive的图像?
我正试图在UI中显示一个图像(位于我的Google Drive帐户中,链接打开,每个人都可以看到该链接),代码如下:Google apps script 如何在GAS UI中显示位于google drive的图像?,google-apps-script,Google Apps Script,我正试图在UI中显示一个图像(位于我的Google Drive帐户中,链接打开,每个人都可以看到该链接),代码如下: var app = UiApp.createApplication().setHeight(150).setWidth(250); var msg = "Suas configurações foram salvas. ;-) "; app.setTitle("Deu certo!"); app.add(app.createVerticalPanel().add(app.crea
var app = UiApp.createApplication().setHeight(150).setWidth(250);
var msg = "Suas configurações foram salvas. ;-) ";
app.setTitle("Deu certo!");
app.add(app.createVerticalPanel().add(app.createLabel(msg)));
app.add(app.createImage("https://drive.google.com/file/d/0B6ItQgqkEUm8VVhwUTBUMkc3a1E/edit?usp=sharing"));
var doc = SpreadsheetApp.getActive();
doc.show(app);
但它不起作用(图像不显示):
https://googledrive.com/host/PUBLIC_FOLDER_ID/FILE_NAME
图像及其文件夹需要在web上以公共形式共享。Bryan的回答是正确的,别忘了你有一个setPixelSize方法来最适合你的Ui中的图像