[Gambas-user] Paint again
Benoît Minisini
gambas at ...1...
Mon Dec 17 14:29:55 CET 2012
Le 17/12/2012 11:49, Charlie Reinl a écrit :
>
> Oh, thats right.
> But sorry, that I don't understand.
> By coding
>
> Paint.Background = Color.Cyan ' set the Background Color
> Paint.Brush = Paint.Color(0) ' set the Foreground Color
> Paint.ClipRect(10, 135,50,22) ' draw Cyan Rectangle
> Paint.Text("Hello",10,135,50,22,3) ' write Hallo into the Rectangle
> Paint.Fill
>
> Paint.Background is really confusing for setting a 'Foreground'
>
Again: Paint.Background and Paint.Brush are the same property, with a
different syntax. There is no "foreground" or "background" color with
the Paint class. Paint.Background is there only to ease the
implementation of the Draw class on top of the Paint class.
Please read the Paint class documentation carefully, and/or the cairo
documentation, to understand the concept of path.
In your code, Paint.Fill() fills the path defined by Paint.Text with the
black color affected to Paint.Brush(), that's all.
Regards,
--
Benoît Minisini
More information about the User
mailing list