Maya Python dynamically scale picture

Maya Python dynamically scale picture

jimKUQZ5
Enthusiast Enthusiast
606 Views
0 Replies
Message 1 of 1

Maya Python dynamically scale picture

jimKUQZ5
Enthusiast
Enthusiast

How to scale a picture to fit a window/layout?

 

FilcP.gif

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 )

 

0 Likes
607 Views
0 Replies
Replies (0)