How to create WebimageView at Runtime

Dear all,

I’m creating a WebimageView at Runtime but image is not displayed on screen

Dim ImageNew as new WebImageView
ImageNew.Picture = Imported_Image_On_Project //Name of the image on the Project
Imagenew.Width = Imported_Image_On_Project.Width
Imagenew.height = Imported_Image_On_Project.height
imagenew.left = 0
imagenew.top = 0
ImageNew.visible = True

Thanks for your help.

You cannot create a control at runtime like that.

Simplest thing to do is to add the WebImageView to your page in the Layout Editor and then specify the image at runtime.

Or if you really need it created at runtime, add a WebContainer with a WebImageView to your project and then add the WebContainer to the page at runtime using WebContainer.EmbedWithin.

Thanks Paul!!!

I was obfuscated in creating the WebImageView without use a Webcontainer.

I’m trying to do this exact thing but my problem is that I don’t know exactly how many images I’ll need, it’s based on a selection made by the user. The images are read from a SQLite database and could be anywhere from 1 to 20. Since a WebImageView cannot be added at runtime is there a way to add them as needed?

If you read the above closely, put the WebImageView in a WebContainer, then create as many WebContainers as you need, which will create that many WebImageViews.