[Gambas-user] Order of Draw.Scale() and Draw.Translate()

Tobias Boege taboege at ...626...
Fri Sep 28 17:50:22 CEST 2012


Hi Benoit,

Hans faces problems with the Draw class. It seems - I didn't test - that the
order of Draw.Scale() and Draw.Translate() impacts the result (produces
error in the wrong order):

  Draw.Begin(dwTest)

  ' Draw.Scale(1, -1)
  ' Draw.Translate(dwTest.W / 2, dwTest.H / 2) ' Error

    Draw.Translate(dwTest.W / 2, dwTest.H / 2) ' First Translate then Scale()
    Draw.Scale(1, -1)

  ' [Note: This is about a clock. T.B.]

  ' Zifferblatt als Bild anzeigen mit Startpunkt(-105|-105)
  ' und  +210 = Bild-Weite sowie +210 = Bild-H?he!
    Draw.Picture(Picture["Images/ziffernblatt.png"], -105, -105, 210, 210)

  ' Sekundenzeiger
    x = iRadius * Cos(winkel_im_bogenmass_S)
    y = iRadius * Sin(winkel_im_bogenmass_S)
    Draw.Foreground = Color.Red
    Draw.Line(0, 0, x, y)
  ' Minutenzeiger
    x = iRadius * Cos(winkel_im_bogenmass_M)
    y = iRadius * Sin(winkel_im_bogenmass_M)
    Draw.Foreground = Color.Green
    Draw.Line(0, 0, x, y)
  ' Stundenzeiger
    x = iRadius * Cos(winkel_im_bogenmass_H)
    y = iRadius * Sin(winkel_im_bogenmass_H)
    Draw.Foreground = Color.Blue
    Draw.LineWidth = 2
    Draw.Line(0, 0, x, y)
  Draw.End

Is that intentional, a bug or...?
The project is said to be in the attachment.

Regards,
Tobi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DrawScaleTest-0.0.21.tar.gz
Type: application/octet-stream
Size: 129697 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20120928/65ad78dd/attachment.obj>


More information about the User mailing list