Rotation in Canvas draws

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Rotation in Canvas draws

Andre Hora
Hello,

I would like to know how to rotate (given a degree or an angle) the draws in a Canvas.

For example: in FormCanvas class>>test1, how to draw the string (or the rectangle, or the oval) vertically instead of horizontally?

FormCanvas class>>test1
...
    canvas drawString: 'Hello, World!' at: 40@40 font: nil color: (Color cyan).
    canvas fillRectangle: ((10@80) corner: (31@121)) color: (Color magenta).
    canvas fillOval: ((10@80) corner: (31@121)) color: (Color cyan).
...


thanks and regards,

--
Andre Hora

Reply | Threaded
Open this post in threaded view
|

Re: Rotation in Canvas draws

Igor Stasenko
On 5 April 2011 12:29, Andre Hora <[hidden email]> wrote:

> Hello,
>
> I would like to know how to rotate (given a degree or an angle) the draws in
> a Canvas.
>
> For example: in FormCanvas class>>test1, how to draw the string (or the
> rectangle, or the oval) vertically instead of horizontally?
>
> FormCanvas class>>test1
> ...
>     canvas drawString: 'Hello, World!' at: 40@40 font: nil color: (Color
> cyan).
>     canvas fillRectangle: ((10@80) corner: (31@121)) color: (Color magenta).
>     canvas fillOval: ((10@80) corner: (31@121)) color: (Color cyan).
> ...
>

canvas asBalloonCanvas
transformBy:
 (MatrixTransform2x3 withAngle: 30)
during: [:can |

  can fillOval: ((10@80) corner: (31@121)) color: (Color cyan).

].
>
> thanks and regards,
>
> --
> Andre Hora
>
>



--
Best regards,
Igor Stasenko AKA sig.

Reply | Threaded
Open this post in threaded view
|

Re: Rotation in Canvas draws

Andre Hora
Hello Igor,

Thanks!
It doesn't rotate the string draw.
canvas drawString: 'Hello, World!' at: 40@40 font: nil color: (Color cyan).

[]'s

On Tue, Apr 5, 2011 at 2:34 PM, Igor Stasenko <[hidden email]> wrote:
On 5 April 2011 12:29, Andre Hora <[hidden email]> wrote:
> Hello,
>
> I would like to know how to rotate (given a degree or an angle) the draws in
> a Canvas.
>
> For example: in FormCanvas class>>test1, how to draw the string (or the
> rectangle, or the oval) vertically instead of horizontally?
>
> FormCanvas class>>test1
> ...
>     canvas drawString: 'Hello, World!' at: 40@40 font: nil color: (Color
> cyan).
>     canvas fillRectangle: ((10@80) corner: (31@121)) color: (Color magenta).
>     canvas fillOval: ((10@80) corner: (31@121)) color: (Color cyan).
> ...
>

canvas asBalloonCanvas
transformBy:
 (MatrixTransform2x3 withAngle: 30)
during: [:can |

 can fillOval: ((10@80) corner: (31@121)) color: (Color cyan).

].
>
> thanks and regards,
>
> --
> Andre Hora
>
>



--
Best regards,
Igor Stasenko AKA sig.




--
Andre Hora

Reply | Threaded
Open this post in threaded view
|

Re: Rotation in Canvas draws

Andre Hora
Could you show me a piece of code (to rotate the string draw)?

On Tue, Apr 5, 2011 at 4:57 PM, Andre Hora <[hidden email]> wrote:
Hello Igor,

Thanks!
It doesn't rotate the string draw.

canvas drawString: 'Hello, World!' at: 40@40 font: nil color: (Color cyan).

[]'s


On Tue, Apr 5, 2011 at 2:34 PM, Igor Stasenko <[hidden email]> wrote:
On 5 April 2011 12:29, Andre Hora <[hidden email]> wrote:
> Hello,
>
> I would like to know how to rotate (given a degree or an angle) the draws in
> a Canvas.
>
> For example: in FormCanvas class>>test1, how to draw the string (or the
> rectangle, or the oval) vertically instead of horizontally?
>
> FormCanvas class>>test1
> ...
>     canvas drawString: 'Hello, World!' at: 40@40 font: nil color: (Color
> cyan).
>     canvas fillRectangle: ((10@80) corner: (31@121)) color: (Color magenta).
>     canvas fillOval: ((10@80) corner: (31@121)) color: (Color cyan).
> ...
>

canvas asBalloonCanvas
transformBy:
 (MatrixTransform2x3 withAngle: 30)
during: [:can |

 can fillOval: ((10@80) corner: (31@121)) color: (Color cyan).

].
>
> thanks and regards,
>
> --
> Andre Hora
>
>



--
Best regards,
Igor Stasenko AKA sig.




--
Andre Hora




--
Andre Hora