PennController for IBEX › Forums › Support › Fit pictures of different size to selector › Reply To: Fit pictures of different size to selector
February 8, 2023 at 3:20 pm
#9902
Jeremy
Keymaster
Hi,
I answered this question via email, but I’m posting the answer here too for other users
The simplest solution in this case is to simply set a max-height and max-width on the Image elements to the same dimensions of the containing Canvas elements:
newCanvas("left", 500, 290) .add( "center at 50%" , "middle at 50%" , getImage("target").css({"max-height":"290px", "max-width":"500px"})), newCanvas("right",500, 290) .add( "center at 50%" , "middle at 50%" , getImage("foil").css({"max-height":"290px", "max-width":"500px"})),
Jeremy