作为一个大项目的一部分,我正在尝试找出如何移动一个对象(在这种情况下是椭圆)。这是导致我麻烦的代码部分:
该函数使用坐标列表来获取新的x和y值。这会导致出现"possible overload"语法错误。我认为我想要做的是这样的:
//updating the position of the ellipse
let updatePoints (form : Form) (coords : vector3Dlist ) dtheta showtime =
let mutable fsttuple = 0
let mutable sndtuple = 0
for i in 0..coords.Length-1 do
fsttuple <- (int (round (fst coords.[i])))
sndtuple <- (int (round (snd coords.[i])))
(fillEllipseform.Paint.Add(fun draw->
let brush=new SolidBrush(Color.Red)
draw.Graphics.FillEllipse(brush,fsttuple,sndtuple,10.0f,10.0f)))
form.Refresh ()
该函数使用坐标列表来获取新的x和y值。这会导致出现"possible overload"语法错误。我认为我想要做的是这样的:
fillEllipseform.X <- fsttuple
如何准确地更改x/y坐标?当涉及到椭圆时,.NET库在F#示例方面非常有限。
Form
does not haveX
andY
properties. It has aLocation
property of typePoint
. Try fillEllipseform.Location <- Point(fsttuple, sndtuple)` - gradbot