pixel dimensions - calculating aspect

I’m having a bit of a brain fart here and can’t seem to get this right.

I have a canvas on a window that I want to re-size based on inputted dimensions - I’m only concerned with the resulting width and height aspect ration of the canvas being the same as the inputted dimensions and being an appropriate size to see on the screen.

In the keyUp event of the Height textfield I have

[code]dim dHeightInches As Double

dHeightInches = Cdbl(tfImageHeight.Text) * 20
cImage.Height = dHeightInches

Return
[/code]

and similar code in the width field.

since the pixels aren’t square I’m not sure what values to use to get the ratio right. Any thoughts would be greatly appreciated

since when?

@Bill Plunkett — Pixels are usually square on common platforms so you don’t need to worry.

never mind, I had another error in the code. as I said, had a brain fart…

at least those ones dont tend to smell :stuck_out_tongue:

and if they do well … now you’ve let the smoke out and its all over

The only place where pixels may not be square is on printers. But the driver takes care of that and make them transparently square to the application.