Google Slides API replace the image but not remained its photograph and size

529 views Asked by At

First I got the old image object as below:

enter image description here

I applied Google Slides API and set the same size code as below:

enter image description here

It can be seen as I set the same size of the pics but the shape is different.

1

There are 1 answers

1
MαπμQμαπkγVπ.0 On

If you are having problem with the size and shape of the image, here is the document that could help you on sizing and positioning of page elements.

When you create a page element, you can specify a size and transform that provide a certain visual result. However, the API may replace your provided values with other ones that yield the same visual appearance. In general, if you write a size using the API, you are not guaranteed to be returned the same size. However, you should get the same results if you take the transform into account.

Here are some important facts about Transforms and Page Elements.

This guide describes the underlying concepts used in transforming (that is, moving, rotating, scaling, and shearing) page elements, focusing especially on the underlying affine transform and its operations.

For more about how to use affine transforms to achieve specific results, see the Size and Position Shapes guide.

The visual size and position of a page element are controlled by two properties: size and transform. The size describes the ideal or native size of the page element being created. The transform specifies a two-dimensional affine transform matrix that specifies how an object at its native size is transformed to result in its final visual appearance.

Just explore the documentation and apply it in your code.

Hope this helps.