Resize picture to fit the image control in userform

Sanmrxl

New Member
Joined
Aug 1, 2007
Messages
36
I have an image file in JPG format, 8MB in size. When I try to load this into an image control of a userform, the picture is not scaling to the image control size, despite all values of the options of "PictureSizeMode". The picture seems to be much bigger beyond the size of the image control and I could not find ways to shrink it to the image control.

I then tried to save this image file as a bmp file, and the file size was just 190 kb. When I try to upload this file, the image again does not fill the image control on display, but this time it is much smaller.

I am trying to find a way to upload the full picture to fit the size of the image control in the userform, if possible for any file format.


The code in the command button of the userform is as below.
UserForm1.Image1.Picture = LoadPicture("Filepath")

Hoping for a solution for this.

( I have been searching for quite a while now, and have come across some seemingly similar questions, but not this exact question.)

Thanks in advance
 
Last edited:

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
There is something which are not correct in you'r image size, in this you write. A JPG file, which should be 8MB in size, would never could reduce to a BMP file on 190KB. The opposit could be correct, but not this you write. If the JPG file really should be on 8MB, it would be very big in original size, and it could give a problem, to load into an image control, I guess.
I often load JPG images in images controls, and it never gives problems.
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,772
Members
452,353
Latest member
strainu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top