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 ?

David Esperalta

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!

David Esperalta

Hello John,

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



Everybody can read the DecSoft's support forum for learning purposes, however only DecSoft's customers can post new threads. Purchase one or more licenses of some DecSoft's products in order to give this and other benefits.