Hi,
When I display an image in a modal dialog, it does not display correctly the first try (looks like just the top 5% renders, but nothing else does), but if you close the dialog and then re-display it, the image displays correctly.
A simple demo is attached. I have extracted the classes used from a large application, hence some unused overhead functionality in the demo.
Thanks for your help!
Neil.
Thanks Luca,
Changing to a PictureBox is the way to go. I did look at that, but couldn’t quite connect the dots to make it work.
The app uploads “documents” (pdfs or images) elsewhere … they are physically stored in the /Resources/UserData/ subfolder, with a database entry record. So the viewer is supplied with a string eg “Resources/UserData/test1.jpg” to view. The image does not exist at design time (in properties or a resx).
Could you show how to wire the PictureBox to dynamically display the string?
Thanks,
Neil
The sample app is setting <img src… width=100% height=100%/>
The width and height set to a percentage in html is the percentage of the container but the html you are setting is just the image. Set an actual size for the image, or set a container element with a size. It’s also a lot better if you use the PictureBox control instead of the HtmlPanel (which is scrollable) to show an image.
Please login first to submit.