[Gambas-user] Picture/Image with correct aspect ratio (G2)

Matti math.eber at ...221...
Thu Mar 15 20:18:25 CET 2012


Hi Rolf,

Square PictureBox is correct.
Stretched has to be set to false.
Then just set Alignment to Center (in code: 3).
That's all.

Matti

Am 15.03.2012 10:14, schrieb Rolf-Werner Eilert:
> Hi folks, this is in Gambas2:
>
> On a form, I have a PictureBox which shall show photos in landscape and
> portrait. So I drew a square PictureBox.
>
> I expected that if the photo has not the same aspect ratio, it will be
> shown with bars of the background color, but when I say Stretched =
> True, the picture will be shown as fitted into the complete PictureBox.
>
> Is there any way to avoid this? Or is the only way to achieve an aspect
> ratio correct display, changing the PictureBox's Height and Width?
>
> Thanks for your answers.
>
> Rolf




More information about the User mailing list