L
Lee Diggins
Hi
I have a number of different size rounded rectangles being inserted at
runtime and would like to apply the same corner radius to each of the rounded
rectangles.
I tried to calculate the rounded rectangle corner radius dynamically based
upon the height of the rectangle, but, unfortunately I cannot produce
consistent results and I can only assume that there's more than the height of
the rectangle that is taken into consideration when sizing the corner or my
calculations are rubbish.
Anyway here's the function I thought would work using base settings of
height and radius I would like applied, the function is used to set the
Adjustments(1) property on the rectangle:
Parameter h is the height of the rectangle
Variables:
bh is base height
br is base radius
p is the precentage base radius is of base height
o is the calculated rectangle radius value
Function CalculateRadius(h As Single) As Single
Dim bh As Single, br As Single, p As Single, o As Single
If h = DATE_H Then
o = RADIUS_RR
Else
bh = DATE_H
br = RADIUS_RR
p = (RADIUS_RR / DATE_H) * 100
o = (h * p) / 100
End If
CalculateRadius = o
End Function
Any pointers, nudges in the right direction, information on what the
Adjustments(1) property for rounded rectangle works (I can't find anything
specific on rectangles) would be greatly appreciated.
Regards,
Lee
I have a number of different size rounded rectangles being inserted at
runtime and would like to apply the same corner radius to each of the rounded
rectangles.
I tried to calculate the rounded rectangle corner radius dynamically based
upon the height of the rectangle, but, unfortunately I cannot produce
consistent results and I can only assume that there's more than the height of
the rectangle that is taken into consideration when sizing the corner or my
calculations are rubbish.
Anyway here's the function I thought would work using base settings of
height and radius I would like applied, the function is used to set the
Adjustments(1) property on the rectangle:
Parameter h is the height of the rectangle
Variables:
bh is base height
br is base radius
p is the precentage base radius is of base height
o is the calculated rectangle radius value
Function CalculateRadius(h As Single) As Single
Dim bh As Single, br As Single, p As Single, o As Single
If h = DATE_H Then
o = RADIUS_RR
Else
bh = DATE_H
br = RADIUS_RR
p = (RADIUS_RR / DATE_H) * 100
o = (h * p) / 100
End If
CalculateRadius = o
End Function
Any pointers, nudges in the right direction, information on what the
Adjustments(1) property for rounded rectangle works (I can't find anything
specific on rectangles) would be greatly appreciated.
Regards,
Lee