I have a Canvas subclass with two properties: Tiling and Scaling. In the Paint event:
[code]Sub Paint(g As Graphics, areas() As REALbasic.Rect) Handles Paint
If Scaling Then
Me.Backdrop = ScalePic(Graphic, Me.Width, Me.Height, 2)
ElseIf Tiling Then
Me.Backdrop = New Picture(Me.width, Me.Height, 32)
For i As Integer = 0 To Me.Width Step Graphic.Width
For j As Integer = 0 To Me.Height Step Graphic.Height
Me.Backdrop.Graphics.DrawPicture(Graphic, i, j)
Next
Next
End If[/code]
Picture is in the ‘Graphic’ property.
But the Canvas doesn’t show anything unless I force an event like resizing the Window. Adding a Me.Invalidate doesn’t change anything.
How come?