> I was wondering if someone could explain to me what the difference is
between the width propery of the picture property of an image and the
width property of the image itself.
I would have guessed that when the stretch property of an image was
set to false and an image was assigned to the picture property, that
Image1.Picture. Width and Image1.width would be the same. This is not
the case.
I need to know with what factor an image is stretched when stretched =
true, and I thought I could use these two different width properties,
thinking that Image1.width is the stretched width and Image1.Picture. width is
the actual width of the image.
Can someone help me figure this out?
The Width property of the Picture object contained within the ImageBox
is measured in something called HIMETRIC units. You can find out more
about this by looking up "HIMETRIC scale mode for value" (without the
quote marks) at the Index tab in VB's help files. To convert the
HIMETRIC units of the Picture to, say TWIPS (the assumed unit of measure
for your ImageBox), you would use the ScaleX and ScaleY methods (see the
help files for all of the conversion types possible).
ScaleX(Image1.P icture.Width, vbHimetric, vbTwips)
So, to find the scale factor by which your picture has been shrunk or
stretched, you could do this
ScaleFactorX = Image1.Width / ScaleX(Image1.P icture.Width, _
vbHimetric, vbTwips)
ScaleFactorY = Image1.Width / ScaleY(Image1.P icture.Width, _
vbHimetric, vbTwips)
Rick - MVP