How to create images dynamically?

How to create images dynamically?


During Run Time i have to create the Image Dynamically.
For Ex:
In my DB i have 5 Rows means i have to show the 5 images[like Folder Image].

Please give if we have a link for dynamic creation of controls..



Hi Devaraj,

Could you provide more details...

1) The images came from...(DB Table with binary field or FileSystem or ExternalURL)
2) Whats are you trying to achieve?

Rafael Pereira
Hmm.. I guess the easier way to achieve that would be through an expression.

Add a local variable "Aux" to your screen of type text.
In the screen preparation get the images URLs from the DB. (I hope you have URLs and not binary.)
Add a foreach cycle and add to the local variable the HTML you need: Aux = Aux + "<img src=IMG_URL/>"
After getting all the images, just add an expression to your screen, "escape content": no, point it to the "Aux" variable and give it a try!
My requirement is  i have table with Field[Image Path] like 1."\Test\Testdoc\Test.jpg" 2."\Test\TestImg\Test1.jpg.Similarly i have many rows.
When i enter in application i want to show the folder "Test"[ with Folder image].When i Click that Folder i must show the Folder "Testdoc".Again i click that folder i must show  the image "Test.jpg" from that path.
This all process will processed in the application during Runtime.It like the "Folder Explorer" in Windows.

Thanks for your Reply
Devaraj -

Use an expression, and set it's value to be something like:

"<img src=""/images/folder" + ImagePath + ".jpg"" />"

Also set "Escape Content" to False.

Replace "ImagePatch" with whatever is holding the path to the image.

Alternatively, you can use the Widget object, and set it to be "Dynamic", that may do what you need. Or put the images in the DB and use the Image object as a "Database" image. Hit F1 for details on either one of those methods.