icon

Foro de Soporte Allplan

[Pregunta] Resizing images in PictureButtonList via Python?

Etiquetas:
  • PythonParts
  • Palette
  • Buttons

Hi guys,

I'm trying to figure out how to make the icons bigger. Right now they look a bit too small in the UI (see the red arrow in the screenshot).

I’m defining the buttons in XML like this:
<Parameter>
<Name>Row1</Name>
<Text>Length</Text>
<ValueType>Row</ValueType>

<Parameter>
<Name>ButtonList1</Name>
<Text>Length=1|Length=2|Length=3</Text>
<Value>LENGTH_1</Value> <!-- selected value -->
<ValueList>LENGTH_1|LENGTH_2|LENGTH_3</ValueList> <!-- list of possible values -->
<ValueList2>param01.png|param02.png|param03.png</ValueList2> <!-- list of picture file names -->
<ValueType>PictureButtonList</ValueType>
</Parameter>
</Parameter>

Is there any way to change the image size using Python code?

Adjuntos (1)

Type: image/png
Descargado 10 veces
Size: 15,60 KiB

Show most helpful answer Hide most helpful answer

Cita de: phu_bui
Hi guys,
I'm trying to figure out how to make the icons bigger. Right now they look a bit too small in the UI (see the red arrow in the screenshot).
...
Is there any way to change the image size using Python code?

Hi there,

Do you mean, you want to make the button bigger? Because making just the icon bigger would crop it to the button size.

In general, you can adjust the height of a control (any control, not only a button) with

<HeightInRow>50</HeightInRow>

The value is the absolute height of the control in pixels. However, when applied on a button, only the button gets higher, not the picture on it. At least that's what I figured out when testing. Maybe you can try it out.

Cheers,
Bart

Cita de: phu_bui
Hi guys,
I'm trying to figure out how to make the icons bigger. Right now they look a bit too small in the UI (see the red arrow in the screenshot).
...
Is there any way to change the image size using Python code?

Hi there,

Do you mean, you want to make the button bigger? Because making just the icon bigger would crop it to the button size.

In general, you can adjust the height of a control (any control, not only a button) with

<HeightInRow>50</HeightInRow>

The value is the absolute height of the control in pixels. However, when applied on a button, only the button gets higher, not the picture on it. At least that's what I figured out when testing. Maybe you can try it out.

Cheers,
Bart