picture height is different from Picture.picture.height 
Author Message
 picture height is different from Picture.picture.height

Dear all,

A error I encountered was that VB gives me two different numbers and have
nothing to do with Scale...

Try this: (Put a small picture in a new picture box)
msgbox Picture1.height
msgbox Picture1.picture.height

You come out with two totally different numbers. Can anyone tell me how to
convert this number from Picture1.Picture.Height to twips. I couldn't see
any relationship between them. I need to use the Picture1.Picture.Height.



Tue, 27 Jun 2000 03:00:00 GMT  
 picture height is different from Picture.picture.height

Picture1.Height is the actual size of the control itself (including any
borders).

Picture1.Picture.Height is the physical size of the bitmap loaded into the
Picture property of the control.

By default they are both in twips (unless you change the ScaleMode).

-Rob

Quote:

>Dear all,

>A error I encountered was that VB gives me two different numbers and have
>nothing to do with Scale...

>Try this: (Put a small picture in a new picture box)
>msgbox Picture1.height
>msgbox Picture1.picture.height

>You come out with two totally different numbers. Can anyone tell me how to
>convert this number from Picture1.Picture.Height to twips. I couldn't see
>any relationship between them. I need to use the Picture1.Picture.Height.



Tue, 27 Jun 2000 03:00:00 GMT  
 picture height is different from Picture.picture.height

They are totally different numbers and have nothing to do if they are twips
or not because I started with a blank form and did it and same results.

Quote:

>Picture1.Height is the actual size of the control itself (including any
>borders).

>Picture1.Picture.Height is the physical size of the bitmap loaded into the
>Picture property of the control.

>By default they are both in twips (unless you change the ScaleMode).

>-Rob


>>Dear all,

>>A error I encountered was that VB gives me two different numbers and have
>>nothing to do with Scale...

>>Try this: (Put a small picture in a new picture box)
>>msgbox Picture1.height
>>msgbox Picture1.picture.height

>>You come out with two totally different numbers. Can anyone tell me how to
>>convert this number from Picture1.Picture.Height to twips. I couldn't see
>>any relationship between them. I need to use the Picture1.Picture.Height.



Tue, 27 Jun 2000 03:00:00 GMT  
 picture height is different from Picture.picture.height

Hi Farshad:

Quote:
>msgbox Picture1.height
>msgbox Picture1.picture.height

>You come out with two totally different numbers. Can anyone tell me how to
>convert this number from Picture1.Picture.Height to twips

If I recall correctly, the picture object returns the height in HiMetric
units; you will have to use the ScaleX and ScaleY methods of the picturebox
to get the height in twips.

Hope this helps,

Doug.



Wed, 28 Jun 2000 03:00:00 GMT  
 picture height is different from Picture.picture.height

I believe the picture's dimensions are actually measured in HiMetric units,
not twips or whatever scalemode you're using.

You'll need to convert the return value using the ScaleX and ScaleY methods.

Quote:

>Dear all,

>A error I encountered was that VB gives me two different numbers and have
>nothing to do with Scale...

>Try this: (Put a small picture in a new picture box)
>msgbox Picture1.height
>msgbox Picture1.picture.height

>You come out with two totally different numbers. Can anyone tell me how to
>convert this number from Picture1.Picture.Height to twips. I couldn't see
>any relationship between them. I need to use the Picture1.Picture.Height.



Wed, 28 Jun 2000 03:00:00 GMT  
 picture height is different from Picture.picture.height

If you set Picture1.AutoSize = True and Picture1.ScaleMode = vbTwips, then
Picture1.ScaleWidth and Picture1.ScaleHeight returns the picture Width and
Height in twips.

Alejandro.

Farshad Hemmati escribi en mensaje ...

Quote:
>They are totally different numbers and have nothing to do if they are twips
>or not because I started with a blank form and did it and same results.


>>Picture1.Height is the actual size of the control itself (including any
>>borders).

>>Picture1.Picture.Height is the physical size of the bitmap loaded into the
>>Picture property of the control.

>>By default they are both in twips (unless you change the ScaleMode).

>>-Rob


>>>Dear all,

>>>A error I encountered was that VB gives me two different numbers and have
>>>nothing to do with Scale...

>>>Try this: (Put a small picture in a new picture box)
>>>msgbox Picture1.height
>>>msgbox Picture1.picture.height

>>>You come out with two totally different numbers. Can anyone tell me how
to
>>>convert this number from Picture1.Picture.Height to twips. I couldn't see
>>>any relationship between them. I need to use the Picture1.Picture.Height.



Wed, 28 Jun 2000 03:00:00 GMT  
 picture height is different from Picture.picture.height

I don't know if this has been said, but anyaway.

Picture1.heigth returns the height of the control.
Picture1.picture.heigth returns the height of the picture IN the control.

Now if you makes the picturebox covering the whole form, and then loads and
160x160 picture into it, then I believe that the two values would be quite
different. At least if autosize is off.

You may have to convert then numbers to the same format to compare them.
Hope this helps!

Roy Magne Indreb?
Alejandro skrev i meldingen ...

Quote:
>If you set Picture1.AutoSize = True and Picture1.ScaleMode = vbTwips, then
>Picture1.ScaleWidth and Picture1.ScaleHeight returns the picture Width and
>Height in twips.

>Alejandro.

>Farshad Hemmati escribi en mensaje ...
>>They are totally different numbers and have nothing to do if they are
twips
>>or not because I started with a blank form and did it and same results.


>>>Picture1.Height is the actual size of the control itself (including any
>>>borders).

>>>Picture1.Picture.Height is the physical size of the bitmap loaded into
the
>>>Picture property of the control.

>>>By default they are both in twips (unless you change the ScaleMode).

>>>-Rob


>>>>Dear all,

>>>>A error I encountered was that VB gives me two different numbers and
have
>>>>nothing to do with Scale...

>>>>Try this: (Put a small picture in a new picture box)
>>>>msgbox Picture1.height
>>>>msgbox Picture1.picture.height

>>>>You come out with two totally different numbers. Can anyone tell me how
>to
>>>>convert this number from Picture1.Picture.Height to twips. I couldn't
see
>>>>any relationship between them. I need to use the

Picture1.Picture.Height.


Thu, 29 Jun 2000 03:00:00 GMT  
 picture height is different from Picture.picture.height

The Picture.Picture.Height in in Hi-metrics.  Thanks, again, Microsoft, for
making things confusing and then documenting them so well!!!

You have to use the ScaleX and ScaleY methods to convert from Hi-metric to
twips, or to pixels if you so desire.  You will not, however, find the
ScaleX and ScaleY methods on the stdPicture object.  Instead, you will have
to resort to using the ScaleX and ScaleY method found on a particular
PictureBox or Form, or on the Printer object.  

Now tell, me, other than for the stdPicture object, who uses Hi-metrics on
a Form, PictureBox, or Printer?  Nobody, that's who!  

Makes perfect sense to me!



Quote:
> Dear all,

> A error I encountered was that VB gives me two different numbers and have
> nothing to do with Scale...

> Try this: (Put a small picture in a new picture box)
> msgbox Picture1.height
> msgbox Picture1.picture.height

> You come out with two totally different numbers. Can anyone tell me how
to
> convert this number from Picture1.Picture.Height to twips. I couldn't see
> any relationship between them. I need to use the Picture1.Picture.Height.



Thu, 29 Jun 2000 03:00:00 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. picture height is different from Picture.picture.height

2. picture height is different from Picture.picture.height

3. picture height is different from Picture.picture.height

4. picture height is different from Picture.picture.height

5. Does the Picture Box have a Max Height?!

6. Picture Box Height Limitation on Win98?

7. Width and Height of a picture object

8. Set the Width and Height of Picture control

9. Sizing picture control to max. height

10. picture object height and width are incorrect.

11. Replacing a pictures properties with another pictures properties

12. convert embedded pictures to linked pictures??

 

 
Powered by phpBB® Forum Software