Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-apps-script/6.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
Google apps script 如何在GAS UI中显示位于google drive的图像?_Google Apps Script - Fatal编程技术网

Google apps script 如何在GAS 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

我正试图在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.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中的图像