Site icon Embarcadero RAD Studio, Delphi, & C++Builder Blogs

How to best load an image from a URL using TWebBrowser when targeting multiple devices

 

In this snippet, I placed a TWebBrowser control onto my FireMonkey form and aligned it to the client. I then set up the following OnFormCreate event to load a web image into the browser control. I also restricted the image size to the screen dimensions of the device.

 

[crayon-673f7e9980119196308499/]

 

As you can see in the screenshots below, regardless of the device dimensions, the image that is loaded from the URL is automatically resized to fit into the client aligned web browser control.

 

 

Exit mobile version