Hello all, i have been looking far and wide for a way to resize an imported image in a MULTIINPUTFORM from datashapes. No matter what size my image is, the node resizes it to the same size.
I have found this in the Python script in the Multiple inputform :
elif j.__class__.__name__ == 'uiimage':
pic = Image.FromFile(j.image)
im = PictureBox()
if j.showborder:
im.BorderStyle = BorderStyle.Fixed3D
else:
im.BorderStyle = BorderStyle.None
ratio = (pic.Height)/(pic.Width)
h = float(pic.Height)
w = float(pic.Width)
ratio = h/w
image_maxsize = formwidth - xlabel - rightmargin
im.Size = Size(image_maxsize,image_maxsize*ratio)
scaledimage = Bitmap(image_maxsize,image_maxsize*ratio)
gr = Graphics.FromImage(scaledimage)
gr.DrawImage(pic,0,0,image_maxsize,image_maxsize*ratio)
im.Image = pic
im.SizeMode = PictureBoxSizeMode.Zoom
formbody.Controls.Add(im)
im.Location = Point(25 * xRatio,y+25*yRatio)
y = im.Bottom + 25 * yRatio
Can someone confirm that the only way for me to change how the node UI.Image Data resizes an image is by editing the code in the MultipleInputForm ?
As reference the nodes i am using:
Dynamo 2.0.3