Corner and corner2 parameters of ExportImage command

Pablo J. Gonzalez Mora shared this question 1 month ago
Answered

I would like to use the ExportImage command only for a limited area of the Graphics (1 or 2).

For this goal, I have thought to use the corner and corner2 parameters. Wiki (https://wiki.geogebra.org/en/ExportImage_Command) explains:

pic1 = ExportImage("view", 2, "corner", A, "corner2", B)

I tried with corner and corner2 parameters inside the scripts linked to the Export buttons, to catch ONLY the area between points A and E.

1a6c606bdfaa8c03ba314df5215cf120


However, the scripts seem not to use the parameters corner and corner2: they export all the graphics (1 or 2). I think I am missing something. I have searched for a long time, without solving this issue.

Here, the applet online: https://www.geogebra.org/m/u77zugjh

Could you help me?

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

Spanish version (versión en español):

Me gustaría usar la instrucción ExportaImagen solamente para un área específica de la vista gráfica (1 ó 2).

Para lograrlo, pensé usar los parámetros esquina y esquina2. El Wiki (https://wiki.geogebra.org/en/ExportImage_Command) muestra su uso mediante la siguiente sintaxis:

pic1 = ExportImage("view", 2, "corner", A, "corner2", B)
He intentado usar ambos parámetros dentro de los guiones enlazados a los botones Export, para capturar SOLAMENTE el área delimitada por los puntos A y E. Sin embargo, pareciera que los parámetros no funcionan: se obtiene una imagen de toda el área gráfica (1 ó 2), no sólo de la sección deseada. Supongo que estoy omitiendo algún detalle importante. He investigado bastante, sin éxito.

En este enlace se puede ejecutar el applet en línea: https://www.geogebra.org/m/u77zugjh.

Agradecería mucho si me pudiesen ayudar.

Comments (10)

photo
2

I’m sorry but I can’t try it now on my iPad.

Have you tried using two opposite corners? So, instead of A and B, use A and E.

Sorry if it doesn’t help. It’s just me thinking loud ;)

photo
3

yo uso la version 5 así que no suelo usar el comando exportimage

en lugar de A y B puntos cualesquiera intenta usar dos puntos llamados Export_1 y Export_2 que es el procedimiento original

no es necesario en ese caso poner "corner",A

simplemente pon los puntos que te digo con esos nombres donde quieras y exporta como suelas hacer

también, y por otra parte, debes estar seguro de que tienes la ultima version de GG pues ya te digo que esta instruccion tal como la quieres usar es muy muy reciente

photo
1

Gracias, mathmagic, por tus oportunas y acertadas respuestas. Funcionó perfectamente.


También uso normalmente la versión 5, mas tengo instalada la versión 6 para este tipo de casos.

Saludos.

photo
photo
2

I could finally try now.

If you are on version 6, your command works fine, but don't assign it a name. I mean, just use


ExportImage("view", 2, "corner", A, "corner2", B)

This way the Export dialog window opens, and you can save the image as you want.


If you assign a name to the command, e.g.


pic1 = ExportImage("view", 2, "corner", A, "corner2", B)

then the image is created and saved in your GeoGebra file. You can see it in the Auxiliary objects.

photo
1

Hi, Simona.

Thanks for your reply.

I tested your suggestion. However, the exported result is of all the graphics view.

8faba3147944c2e2d6bac7123faa12c7

(I want A-E area)


I think I am missing something yet.

photo
photo
2

I had the same problem as OP, but mathmagic's solution worked: create two points called Export_1 and Export_2 in your desired corners. Then run ExportImage() without any "corner" parameters. Geogebra will automatically use Export_1 and Export_2 as the corners, which I think is functionality carried over from https://wiki.geogebra.org/e.... I'm using Version 6.0.553.0-wgraphing, and I think the "corner" and "corner2" parameters of ExportImage() just don't work right now.

photo
2

"corner" and "corner2" are to set the corners of the resultant image (not to crop the export) - manual updated to clarify:https://wiki.geogebra.org/e...

photo
1

Thanks, Michael.

photo
photo
1

Mathmagic's suggestion worked very fine on version 6.0.541.0.

With "corner" and "corner2" the result is all the graphics view: running it locally and running online.

The .pdf output has the exact size if it is executing online, and bigger on local running (however only with the wanted objects).

Thanks to all.

photo
1

Mathmagic's suggestion worked very fine on version 6.0.541.0.

With "corner" and "corner2" the result is all the graphics view: running it locally and running online.

The .pdf output has the exact size if it is executing online, and bigger on local running (however only with the wanted objects).

Thanks to all.

© 2019 International GeoGebra Institute