用VB.net画一个梯形,c语言画梯形
VB.net中如何画图?
VB.net与VB不同。
成都创新互联公司自成立以来,一直致力于为企业提供从网站策划、网站设计、成都做网站、网站建设、外贸营销网站建设、电子商务、网站推广、网站优化到为企业提供个性化软件开发等基于互联网的全面整合营销服务。公司拥有丰富的网站建设和互联网应用系统开发管理经验、成熟的应用系统解决方案、优秀的网站开发工程师团队及专业的网站设计师团队。
VB.net已经有专门绘图的类。
可以定义笔刷然后用Drawing类中的方法绘制。
Private Sub DrawEllipse()
Dim myPen As New System.Drawing.Pen(System.Drawing.Color.Red)
Dim formGraphics as System.Drawing.Graphics
formGraphics = Me.CreateGraphics()
formGraphics.DrawEllipse(myPen, New Rectangle(0,0,200,300))
myPen.Dispose()
formGraphics.Dispose()
End Sub
Private Sub DrawRectangle()
Dim myPen As New System.Drawing.Pen(System.Drawing.Color.Red)
Dim formGraphics as System.Drawing.Graphics
formGraphics = Me.CreateGraphics()
formGraphics.DrawRectangle(myPen, New Rectangle(0,0,200,300))
myPen.Dispose()
formGraphics.Dispose()
End Sub
用vb语言编写一个计算梯形面积的程序
#include void main() { float a, b, h; // 梯形的上底、下底和高 printf("请依次输入梯形的上底、下底和高:"); scanf("%f%f%f", a, b,h); printf("梯形的面积:%f", (a+b)*h/2); }
vb程序代码中的梯形公式怎么编写
's=(上底+下底)×高÷2
private
sub
form_load()
me.show
a
=
val(inputbox("请输入梯形上底"))
b
=
val(inputbox("请输入梯形下底"))
h
=
val(inputbox("请输入梯形的高"))
"梯形上底=";
a
"梯形下底=";
b
"梯形高=";
h
"梯形面积=";
(a
+
b)
*
h
/
2
end
sub
求用vb ,用双重循环,打印一个等腰梯形,等腰三角形和正方形图案,用“*”打印,谢谢!
Private Sub Command1_Click() '等腰三角形
Dim i As Integer, n As Integer
n = 5
For i = 1 To n
Print Space(n - i); String(2 * i - 1, "*")
Next
End Sub
Private Sub Command2_Click() '正方形
Dim i As Integer, n As Integer
n = 5
For i = 1 To n
For j = 1 To n
Print "* ";
Next
Next
End Sub
Private Sub Command3_Click() '等腰梯形
Dim i As Integer, n As Integer, m As Integer
n = 5
m = 5
For i = 1 To n
Print Space(n - i); String(2 * i - 1 + m, "*")
Next
End Sub
vb.net画一个矩形图片的代码
g = Me.picDisplay.CreateGraphics
Dim mybrush As Brush = New SolidBrush(Map_Empty_Color)
Dim rect2 As System.Drawing.Rectangle = New System.Drawing.Rectangle(0, 0, Map_Width, Map_Height)
g.FillRectangle(mybrush, rect2)
分享标题:用VB.net画一个梯形,c语言画梯形
标题链接:http://pwwzsj.com/article/hededj.html