user90
user90

Reputation: 381

R shiny imageOutput size change

I have images of size 1770x2101 pixels (l.png,n.png,a.png) and need to render 100 * 300 pixel size

ui

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

server

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)

But image is not resizing.

Upvotes: 1

Views: 1513

Answers (1)

St&#233;phane Laurent
St&#233;phane Laurent

Reputation: 84529

You have to set the dimensions in renderImage:

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

Upvotes: 3

Related Questions