r - 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)
但是图像没有调整大小。
解决方案
您必须在以下位置设置尺寸renderImage
:
list(src = Leg, width = "100%", height = "300")
推荐阅读
- javascript - Discord.js bot - 在设置中创建角色导致 RangeError
- macos - 我在 Macbook Pro 上只有 Firefox OverconstrainedError
- swift - 变量更改后更新屏幕上的文本 I Xcode Swift5
- r - tidyverse 中的分组事件链 ID
- cassandra - 如何在 Cassandra 主键中查找范围?
- amazon-web-services - Fargate 任务的环境变量设置
- php - 如何从供应商文件夹中正确设置配置路径?
- mongoose - Mongoose 聚合匹配字段值等于没有 $expr 的变量?
- node.js - 使用 saml2-js 库从 SAML 请求创建 SAML 响应
- algorithm - 从推荐中删除重复项