Is there any way to get the applet size by code?

Javier Cayetano Rodríguez shared this question 9 months ago
Answered

In order to insert an applet on a web using the API https://wiki.geogebra.org/en/Reference:GeoGebra_Apps_API, it is mandatory to inlude its dimensions (height and width) https://wiki.geogebra.org/e....


Would it be possible to use the applet default dimensions? (to show the applet of the same size as it is uploaded on geogebra)

or at least obtain those values by code ( I mean, a command like "getWidth" or "getHeight"). [I know I can manually get them by clicking on the properties]


It would be very useful if I want to insert an applet just by knowing its address.


Thank you.

Best Answer

Comments (3)

photo
1

Thank you very much!

Very interesting. I think it will do

photo
photo
1

Edited: I see that my suggestion doesn't answer the question.


Original answer:


--------------


For a command like "getWidth" or "getHeight", try with Corner(5) (on GeoGebra environment):


SetValue(getWidth, x(Corner(5))

SetValue(getHeight, y(Corner(5))


So, you get the current size of the applet in pixels.


More about Corner command:

https://wiki.geogebra.org/e...

© 2020 International GeoGebra Institute