Hi
I was trying out the drawing functions in the .NET library and have
come across something quite strange. I have tried everything I can
think of so I'v decided to post my problem here.
When I try to compile the following code I get this error "It is not
possible to invoke an expression of type 'System.Drawing.Font'". Is
this something I have done? or is it a bug in Boo? I presume it's
possible to use the Font constructors in C#.
The code:
import System
import System.Windows.Forms
import System.Drawing
import System.Drawing.Drawing2D
import System.Drawing.Imaging
import System.Drawing.Text
class Woo(Form):
font as Font
def constructor():
super()
font = Font(FontFamily("Times New Roman"), 24, FontStyle.Regular,
GraphicsUnit.Pixel)
override def OnPaint(e as PaintEventArgs):
g = e.Graphics
g.DrawLine(Pens.Orange, Point(100, 100), Point(0, 0))
g.DrawString("asdf", font, Brushes.Chartreuse, 50, 50)
woo = Woo(Text: "wooooooo")
woo.ShowDialog()