|
-
Aug 23rd, 2019, 12:03 PM
#1
Resize Image Control at runtime
I am stuck in a very peculiar situation. Seems like no one has ever asked this question before or maybe I am not able to search for it.
There is a Userform in Excel. It has an Image Control. It's PitcutreSizeMode = fmPictureSizeModeClip. I know I can change the PitcutreSizeMode to Zoom or Stretch but I do not want to do that. What I want is at runtime, the size of the control should resize to match the image's size. The image is already embeded inside the Image control. I do not want to use the relative path of the image.
Let's say we have the following measurements when the userform is initialized
Image1.Height: 54
Image1.Width: 84
Image1.Picture.Width: 5821
Image1.Picture.Height: 3874
This is what I am trying to achieve.

Any idea on how do I proceed with this?
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|