Dynamically Adding Pictures to the Screen


John Clarke
I want to create an application where if I click on the screen it dynamically adds an image to it. So lets say this image is 30 pixels by 30 pixels. If I click on the app screen 10 times I will have 10 instances of that image (one instance at each point I clicked). How can I achieve this ?

DecSoft

Hello John,

You place a non too much specific question, that is, something like "I am trying this and this other but I expect this result and get this error message..."... It's possible to do something like you wanted using a bit of Javascript, and, one of the ways in which we can think is what you can see in the below app sample:

Save the above code in a file and save it as "MyApp.ab", for example. Before open the file with DecSoft App Builder, look in your computer for a PNG image and copy it aside the "MyApp.ab" file with the name: "butterfly.png". Now yes, open "MyApp.ab" with DecSoft App Builder and run the app.

As you can see, every time you click the view (and the app, since we use the scale app option), the butterfly appear in the position that you clicked.



John Clarke
You are brilliant - that is exactly what I wanted! Thank you so much!

DecSoft

Hello John,

If the sample can be useful for you that's the point! :-)


Todo el mundo puede leer el foro de soporte de DecSoft para aprender del mismo, sin embargo, sólo los clientes de DecSoft pueden abrir nuevos hilos. Compre una o más licencias de productos de DecSoft y obtendrá este y otros beneficios.

Este sitio utiliza "cookies" útiles para almacenar sus preferencias.

Bien. Ocultar esta nota. Obtener más información.