[Gambas-user] Font rotation?

ron ronstk at ...239...
Tue Apr 13 21:27:00 CEST 2004


On Tuesday 13 April 2004 21:03, Benoit Minisini wrote:
> 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.

picturebox1.picture=image.rotate(90) maybe ???
The help is broken here for image.rotate() so I could not see it returns a 
picture or this method was a static one ;=)

I found it a very clever one but 

>
> 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,

is much nicer.

Ron




More information about the User mailing list