 |
|
รบกวนขอคำเเนะนำเรื่องการเซตค่าพิกัด x y ในการสร้างรูป 3 เหลี่ยม ใน vb 2008 หน่อยครับพี่ๆทุกๆคน |
|
 |
|
|
 |
 |
|
รบกวนหน่อยนะครับ
ตอนนี้ผมกำลังศึกษอย่างเต็มที่เลยครับ รบกวนชี้เเนะน้องใหม่หน่อยครับผม
|
 |
 |
 |
 |
Date :
2011-01-24 22:48:44 |
By :
devilkiller |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ยังทำอยู่ครับบ
|
 |
 |
 |
 |
Date :
2011-01-25 07:47:56 |
By :
devilkiller |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เนื่องจาก จขกท ไม่บอกว่าเป็นสามเหลี่ยมอะไร ผมขอเดาว่าเป็นสามเหลี่ยมด้านเท่าละกัน
เริ่มแรกก็พลอตจุดบนวงกลมก่อน จุดถัดไปจะห่างกัน 120,240 องศาพอดี
Code (VB.NET)
Public Class Form1
Private Function Cos(ByVal pAngel As Double, ByVal pRadius As Double) As Double
Dim rad As Double = 2 * Math.PI * (pAngel / 360)
Return Math.Cos(rad) * pRadius
End Function
Private Function Sin(ByVal pAngel As Double, ByVal pRadius As Double) As Double
Dim rad As Double = 2 * Math.PI * (pAngel / 360)
Return Math.Sin(rad) * pRadius
End Function
''' <summary>
''' วาดสามเหลี่ยม
''' </summary>
''' <param name="pCenterX">จุดกึ่งกลาง x</param>
''' <param name="pCenterY">จุดกึ่งกลาง y</param>
''' <param name="pRadius">รัศมีสามเหลี่ยม</param>
''' <param name="pStartAngel">มุมเริ่มต้น</param>
''' <returns>รูบสามเหลี่ยม</returns>
''' <remarks></remarks>
'''
Private Function makeTriangel(ByVal pCenterX As Integer, ByVal pCenterY As Integer, ByVal pRadius As Integer, ByVal pStartAngel As Integer) As Bitmap
Dim p0 As New Point(pCenterX + Cos(pStartAngel, pRadius), pCenterY + Sin(pStartAngel, pRadius))
Dim p1 As New Point(pCenterX + Cos(pStartAngel + 120, pRadius), pCenterY + Sin(pStartAngel + 120, pRadius))
Dim p2 As New Point(pCenterX + Cos(pStartAngel + 240, pRadius), pCenterY + Sin(pStartAngel + 240, pRadius))
Dim bmp As New Bitmap(Me.Width, Me.Height)
Dim g As Graphics = Graphics.FromImage(bmp)
g.SmoothingMode = Drawing2D.SmoothingMode.AntiAlias
g.DrawEllipse(New Pen(Color.Gray, 5), pCenterX - pRadius \ 2, pCenterY - pRadius \ 2, pRadius, pRadius)
g.DrawEllipse(New Pen(Color.Gray, 5), pCenterX - pRadius, pCenterY - pRadius, pRadius * 2, pRadius * 2)
g.DrawLines(New Pen(Color.Red, 5), New Point() {p0, p1, p2, p0})
Return bmp
End Function
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Me.BackgroundImage = makeTriangel(Me.Width \ 2, Me.Height \ 2, 150, 180)
End Sub
End Class
|
 |
 |
 |
 |
Date :
2011-01-28 16:52:28 |
By :
Programmer Of Persia |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
[size=10pt][size=10pt][size=10pt][size=10pt]รบกวนด้วยนะคะ ตอนนี้กำลังทำโปรเจคที่มีการเขียนรูปแบบ ไอโซเมตริกคะ ไม่รู้ว่าจะเริ่มยังไง รบกวนตอบด้วยนะคะ ทำใน VB2008 คะ[/size][/size][/size][/size]
|
 |
 |
 |
 |
Date :
2011-04-26 14:45:55 |
By :
8owling |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
รบกวนด้วยนะคะ ตอนนี้กำลังทำโปรเจคที่มีการเขียนรูปแบบ ไอโซเมตริกคะ ไม่รู้ว่าจะเริ่มยังไง รบกวนตอบด้วยนะคะ ทำใน VB2008 คะ
|
 |
 |
 |
 |
Date :
2011-04-26 14:52:23 |
By :
8owling |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|