We help IT Professionals succeed at work.

how do I srink the picture box ?

johnmemor
johnmemor asked
on
I have a picture box, and it's scalemode is pixel.
How do I shrink the picture into 100 x 50 ?
Comment
Watch Question

Commented:
Use an image control, and set the stretch property = true.
No scalemode, but it's easy enough to translate.

CERTIFIED EXPERT
Commented:
 Dim sPic As StdPicture
  Picture1.AutoRedraw = True
  Picture1.ScaleMode = vbPixels
  Set sPic = Picture1.Picture
  Picture1 = LoadPicture()
  Picture1.PaintPicture sPic, 0, 0, 100, 50, 0, 0, Picture1.ScaleWidth, Picture1.ScaleHeight, vbSrcCopy
  Picture1.Width = 100 * Screen.TwipsPerPixelX
  Picture1.Height = 50 * Screen.TwipsPerPixelX
  Set sPic = Nothing

Cheers

Commented:
simply Use the image control, and set the stretch property = true.

Commented:
echoooooo?
Ark
CERTIFIED EXPERT

Commented:
Sorry for typo, should be
Picture1.Height = 50 * Screen.TwipsPerPixelY

Explore More ContentExplore courses, solutions, and other research materials related to this topic.