首页 > 解决方案 > R闪亮图像输出大小变化

问题描述

我有大小为 1770x2101 像素(l.png、n.png、a.png)的图像,需要渲染 100 * 300 像素大小

用户界面

imageOutput("myImage", width = "100%", height = "300px"))

服务器

output$myImage <-renderImage({
if (input$l == 'l') Leg<-"www/l.png"
if (input$l == 'n') Leg<-"www/n.png"
if (input$l == 'b') Leg<-"www/b.png"
if (input$l == 'a') Leg<-"www/a.png"
list(src=Leg)
},deleteFile = FALSE)

但是图像没有调整大小。

标签: rshiny

解决方案


您必须在以下位置设置尺寸renderImage

list(src = Leg, width = "100%", height = "300")

推荐阅读