[Gambas-user] Font rotation?

Benoit Minisini gambas at ...1...
Tue Apr 13 21:03:14 CEST 2004


On Tuesday 13 April 2004 19:04, ron wrote:
> On Tuesday 13 April 2004 18:36, Daniel Campos wrote:
> > Hi all:
> >
> > Is there any way to rotate a text, for example 45 or 90 degrees?
> > I'd need it to draw some charts, and it would be also userful
> > in games, and scientific-graphical programs...
> >
> > Regards,
>
> I gues
>
> dim pict as picture
> dim img as image
>
> label1.text="mytext"
>
> pict = label1.grab
> image.picture = pict
> 'or
> image.picture = label1.grab
>
> image.rotate(90) ' help is broken here
> 'somewhere else in th help
> 'Function Rotate(angle AS float) as picture
>
> 'use a picture box vertical
> picturebox1.picture=image.picture
>
> Ron
>

My god, what a hack ! :-) And it does not work as the Rotate method returns a 
new Image, and does not modify the one it is applied to.

You should better draw the text directly in the picture:

DIM hPict AS New Picture(256, 64)

hPict.Fill(Color.White)
Draw.Begin(hPict)
Draw.Text("MyText", 0, 0, 256, 64)
Draw.End
hPict = hPict.Rotate(90)
...

Regards,

-- 
Benoit Minisini
mailto:gambas at ...1...




More information about the User mailing list