Set Height Property of image control

B

Bill

I've tried to set the image height of an
image control in the OnOpen code:

Me.ctlImage.Height = 1.193 * Me.ctlImage.Width

such that it will conform to the aspect
ratio of images to be displayed.

The assignment statement didn't have any
affect. With a debug stop after the statement,
neither the height or width show any value.

What do I need to do here to set the Height
property of the image control?

Thanks,
Bill
 
B

Bill

I see I need to do two things. One is that the
width needs to be obtained with the ImageWidth
property. And two, that I need to deal with these
quantities being in twips.

What still puzzles me is that the width property
of the control in design mode shows 1.4", but
ImageWidth / 1440 = 1.97", having written
the ImageWidth to the screen so I could see
ImageWidth value in twips at 2804.

Isn't 1440 the correct value to use in the conversion?

Bill
 
E

Evi

To convert cm to twips use the formula
* 566.929133858
(1440 is for inches and I'm trying hard to wean myself off them)
I usually include the line in code where I want sizes
Dim MyTwip As Double
MyTwip = 566.929133858

Then I can have stuff like
LineThickness = 8
WidthOfBox = 15 * MyTwip
DistFromTop = 6.5 * MyTwip
DistFromLeft = 0 * MyTwip
HeightOfLine = 6 * MyTwip
MyColor = 12632256
'grey line
Me.DrawWidth = LineThickness
Me.Line (DistFromLeft, DistFromTop)-Step(WidthOfBox, HeightOfLine), MyColor,
B

(Draws a grey box 15cm wide, 6.cm from the top of the page, 0cm from the
left, 6cm high)
Evi
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top