如何在GAS UI中显示位于谷歌驱动器上的图像? [英] How do I display an image located at google drive in a GAS UI?
本文介绍了如何在GAS UI中显示位于谷歌驱动器上的图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图在以下代码的用户界面中展示图片(位于我的Google云端硬盘帐户中,并且链接处于打开状态以供所有人查看链接):
I'm trying to display an image (located at my Google Drive account and with link open to view to everyone with the link) in an UI with this code:
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);
但它不起作用(图片不显示):
But it didn't work (the image isn't displayed):
推荐答案
https://googledrive.com/host/PUBLIC_FOLDER_ID/FILE_NAME
图片及其文件夹需要在网络上公开分享。
Image and it's folder need to be shared as public on the web.
这篇关于如何在GAS UI中显示位于谷歌驱动器上的图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文