[Gambas-user] Font rotation?
ron
ronstk at ...239...
Wed Apr 14 16:13:24 CEST 2004
On Wednesday 14 April 2004 14:15, danielcampos at ...282... wrote:
> >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)
> >...
>
> Mmmh... yes, this is cleaner :-)
>
I belive to
Where on the form can you see it.?
DIM hPict AS New Picture(256, 64) ' on what as parent ?
the line gives a syntax error here
in help are the argument even not given as possible.
Again a undocumented feature. :)
hPict = hPict.Rotate(90)
unknown symbol Rotate in class Picture
with these two lines it is not importand the middle part works.
Picture
This class represents :
A Pixmap, i.e. an bitmap located on the X server memory.
An Image, i.e. a bitmap located on the X client memory.
A Metafile, i.e. a vectorized drawing.
When I'm right you must have a PictureBox on your form
and the last line must be
PictureBox1.Picture = hPict.Rotate(90)
and this should the also not work. :(
So it is very clean indeed.
Sorry but the example does not work here.
My gues in working situation is not so bad at all
=================================
> > 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
this was the only major miss I could not see
> > 'somewhere else in th help
> > 'Function Rotate(angle AS float) as picture
> >
> > 'use a picture box vertical
> > picturebox1.picture=image.picture
but i'm sure you should get it working
And here as it works for me taken from the trial
=================================
PUBLIC SUB Button1_Click()
DIM hPicture AS NEW Picture
DIM hImage AS NEW image
hPicture =label1.Grab() '<-- this returns picture
hImage = hPicture.Image ' copy picture to image
hImage = hImage.Rotate(90.0) '<-- this returns picture '
picturebox1.picture= hImage.Picture ' result was 90 degree
END
=================================
My trail program follws below.
Help is very misleading in this project :-(
PUBLIC SUB Button1_Click()
DIM hPicture AS NEW Picture '()
'regarding the help example but with () i get error
DIM hImage AS NEW image
label1.text="mytext"
'Control.Grab
' FUNCTION Grab() AS Picture
IF 11=22 THEN
hPicture =label1.Grab() '<-- this returns picture
'somewhere else in th help
'Function Rotate(angle AS float) as picture
'Image
' This control IS a label that shows a picture.
' hImage = NEW Image ( Parent AS Container )
' and support Rotate
hImage = hPicture.Image ' copy picture to image
' it works but i do not how
'image.picture
' Picture
' Returns OR sets the picture displayed IN the control.
' PROPERTY Picture AS Picture
'hImage.Picture = hImage.Rotate(90.0) '<-- this returns picture
' due i get picture I must use hImage.Picture
' and hImage.Picture is READ only as error
hImage = hImage.Rotate(90.0) '<-- this returns picture '
' works but should give error?
ELSE
' second trial
'hImage is now image type?
' hImage = label1.grab()'<-- this returns picture
' wanted image but got picture instead.
' so try
' hImage.picture = label1.grab()'<-- this returns picture
' and hImage.Picture is READ only as error
' only
hPicture =label1.Grab() '<-- this returns picture
' seems to work
'can only rotate on image
hImage=hPicture.Image 'does it
'image.rotate(90) ' help is broken here
' somewhere else in the help
' Function Rotate(angle AS float) as picture
'hPicture.Picture =hImage.Rotate(90.0) '<-- this returns picture
'how here it IS here a image ?
'wanted pictuere got image instead ??
' hPicture =hImage.Rotate(90.0)
' wanted picture, got image instead ? it is a picture!
' hPicture.Image =hImage.Rotate(90.0)
' hPicture.Image is READ only ??
' help is broken her so I can't see
hImage = hImage.Rotate(90.0) '<-- this returns picture
' and here it does it very well
' a picture in a image
' hImage is now picture type?
ENDIF
'use a picturebox vertical
picturebox1.picture= hImage.Picture ' result was form1 90 degree
'picturebox1.picture = hPicture
' result was form1 no rotate
'picturebox1.picture= hImage.rotate(45.0)
' result in error
picturebox1.picture= hPicture.rotate(45.0)
' result error unknow rotate in pictureclass
picturebox1.picture= hPicture.Image.Rotate(45.0)
'wanted picture got image.
END
More information about the User
mailing list