[EXAMPLES]

* NEW: Enhance the Painting example with a rotate and a scale sliders.

git-svn-id: svn://localhost/gambas/trunk@2551 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Benoît Minisini 2009-12-30 14:04:25 +00:00
parent 1528d689fc
commit 26e37e4a53
2 changed files with 38 additions and 10 deletions

View file

@ -248,12 +248,23 @@ End
Public Sub DrawingArea1_Draw()
'Dim hImage As New Picture(512, 512) 'Image(512, 512, Color.White)
'hImage.Fill(Color.White)
'Paint.Begin(hImage)
Paint.Scale(sldScale.Value / 100, sldScale.Value / 100)
Paint.Translate(128, 128)
Paint.Rotate(Rad(sldRotate.Value))
Paint.Translate(-128, -128)
Object.Call(Me, $sFunctionName)
'Paint.End()
'Draw.Picture(hImage, 0, 0)
End
Public Sub sldRotate_Change()
DrawingArea1.Refresh
End
Public Sub sldScale_Change()
DrawingArea1.Refresh
End

View file

@ -1,11 +1,11 @@
# Gambas Form File 3.0
{ Form Form
MoveScaled(0,0,119,77)
MoveScaled(0,0,98,77)
Text = ("")
Arrangement = Arrange.Fill
{ HSplit1 HSplit
MoveScaled(1,1,113,74)
MoveScaled(1,1,96,74)
{ VBox1 VBox
MoveScaled(1,1,35,71)
Spacing = True
@ -59,16 +59,33 @@
Tag = "8"
Text = ("Fill and stroke")
}
{ Label1 Label
MoveScaled(2,36,19,2)
Text = ("Rotate")
}
{ sldRotate Slider
MoveScaled(1,39,31,3)
MaxValue = 360
}
{ Label2 Label
MoveScaled(2,43,19,2)
Text = ("Scale")
}
{ sldScale Slider
MoveScaled(1,47,31,3)
MinValue = 100
MaxValue = 400
}
}
{ TabStrip1 TabStrip
MoveScaled(37,1,72,72)
MoveScaled(37,1,55,72)
Arrangement = Arrange.Fill
Margin = True
Count = 2
Index = 0
Text = ("Preview")
{ DrawingArea1 DrawingArea
MoveScaled(2,1,62,45)
MoveScaled(2,1,38,45)
Background = &HFFFFFF&
Painted = True
Border = Border.Plain