Resize URL Images to fit a bounding box in a form

New Contributor

Hi, 

I need some help achieving the following. 

How to limit URL image size in MS Access form. Reduce size to match the container. ie the image is large an exists at URL\xxxx. I want to pull this image back and present it in a form. I want the image to resize itself to fit the container box I create. 

 

I have many images located at many URLs. However all these pictures are like the size of wallpapers. I want to show these images in my form but at a much smaller size

 

At the moment I have a box 5cm x 6 cm and the box produces scroll bars and shows me all the white space in the top left of that picture. I want the URL picuture to scale to fit the box and thus show me the meaningful content. 

 

Can it be done?

I need step by step instructions if possible

 

thank you in advance

JG

7 Replies

@GomesGomes 

You could study the demo that can be downloaded from my project VBA.PictureUrl .

It scales the downloaded images to fit within the picture control.

@GomesGomes 

Have you tried simply changing the image control's Size property and setting it to Zoom?

 

Another option is to resize the original images to the dimensions of your control, you can easily do so using WIA, see:

 

https://www.devhut.net/2017/01/18/vba-resize-image/

 

@GomesGomes 

Not sure why my reply didn't go through, let's try this again?!

 

Have you tried setting the Size property for the image control to Zoom?  See: https://docs.microsoft.com/en-us/office/vba/api/Access.Image.SizeMode

 

The alternative is to dynamically resize the images which can easily be done using WIA, see: https://www.devhut.net/2017/01/18/vba-resize-image/

Hi Gustav, Thank you for the response ...too complicated for my skill set.
Hi Daniel, Thank you for the response ...too complicated for my skill set.
Changing a single control property (size) is to complicated? If you want post your db here and someone can take a closer look at it.

@GomesGomes I guess not. The demo works right away, and the code is copy-paste.