How to scale a picture to fit a window/layout?
With the code below the original image is not actually enlarged to 300px, it is displayed with the original image size instead.
import maya.cmds as cmds
if (cmds.window(window1, exists=True)):
cmds.deleteUI(window1)
window1 = cmds.window(w=300, h=300)
layout = cmds.columnLayout(w=300, h=300)
cmds.picture( image='image.png', w=300, h=300)
cmds.showWindow( window1 )