VB 怎样画有角度的直线?

来源:百度知道 编辑:UC知道 时间:2024/05/14 17:16:15

'(x,y) <== StartPoint
'distance <== the distance of the line
'theta <=== angle of the line in degree
sub newline(x,y ,distance,theta)
dim pi as single
dim x2 as integer,y2 as integer
pi=3.1415926
x2=x+ditsance*cos(theta*pi/180)
y2=y+distance*sin(theta*pi/180)
line (x,y)-(x2,y2),color
end sub

me.line (0,0)-(1000,1000)