Go Back   Forum Care Forums > Development Reference Area > Visual Basic

Reply
 
LinkBack Thread Tools Display Modes
Difference between Image1.Picture.Width and Image1.width
Old
  (#1)
Sandra Setz
Guest
 
Posts: n/a
Default Difference between Image1.Picture.Width and Image1.width - 06-04-2007, 09:44 AM

Hi,

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 ***igned 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?

Thanks in advance,
Sandra
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Re: Difference between Image1.Picture.Width and Image1.width
Old
  (#2)
Rick Rothstein
Guest
 
Posts: n/a
Default Re: Difference between Image1.Picture.Width and Image1.width - 06-04-2007, 09:44 AM

> 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 ***igned 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 ***umed 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.Picture.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.Picture.Width, _
vbHimetric, vbTwips)
ScaleFactorY = Image1.Width / ScaleY(Image1.Picture.Width, _
vbHimetric, vbTwips)

Rick - MVP


   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Re: Difference between Image1.Picture.Width and Image1.width
Old
  (#3)
Sandra Setz
Guest
 
Posts: n/a
Default Re: Difference between Image1.Picture.Width and Image1.width - 06-04-2007, 09:45 AM

"Rick Rothstein" <EMAIL REMOVED> wrote:
> So, to find the scale factor by which your picture has been shrunk or
> stretched, you could do this
>
> ScaleFactorX = Image1.Width / ScaleX(Image1.Picture.Width, _
> vbHimetric, vbTwips)
> ScaleFactorY = Image1.Width / ScaleY(Image1.Picture.Width, _
> vbHimetric, vbTwips)



Yes, this is what I was looking for. Thank you.

Sandra
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Contact Us - Forum Care Forums - Archive - Top