Plz help me. I need to display the text around ellipse as shown in fig. in visual basic. Plz let me know how to do that.

ThankQ

eXeption

02-11-2005, 10:39 AM

Hi,

Plz help me. I need to display the text around ellipse as shown in fig. in visual basic. Plz let me know how to do that.

ThankQ

Shall I suggest something?!

A way to do this is to sub-divide an ellipse into smaller line segments. Let the number of line segments be 'N', and the length of the string to be wrapped around them be 'Sn', such that
Sn = Len("Test String")
Now we can set a spacing variable 'SpcVal' which denotes, the number of line segments between two consecutive characters in the string after it has been wrapped to the ellipse; very simple to compute... SpcVal = N/Sn

Now we know corresponding to which all subdivided line segments, we have to write each characters in the string;
ie First character in the string shall be written on '0'th line segment, then the second character on 'Spcval'th line segment... ie 'n'th character shall be written on 'n * SpcVal'th line segment...

Now we've decided which all characters are to written on which all line segments, How to do it is to compute the position and the angle for each character according to the position and slope of the corresponding line segment and to draw it.

The position can be calculated easily, now the angle is the angle of the 'normal' of the line segment making with horizontal.

see attatched image...

Here is a simple way to subdivide an ellipse! The ellipse is drawn on the form using small line segments, whose size can be controlled by using the 'dtheta' parameter.

' Start a new project and paste this as the form's code!
Option Explicit