' details of bitmap
Dim bm As New Bitmap(1000, 1000)
Dim graph As Graphics = Graphics.FromImage(bm)
'when mouse down on pic draw values
Private Sub PictureBox1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseDown
Dim rad As Double
Dim angle As Integer
rad = angle * System.Math.PI/180
'equations for rotate lines
Dim x As Integer = System.Math.Sin(rad) - System.Math.Cos(rad)
Dim y As Integer = System.Math.Sin(rad) + System.Math.Cos(rad)
Dim z As Integer = System.Math.Cos(rad) + System.Math.Sin(rad)
graph.DrawLine(New Pen(Color.Orange, 1), 150 + e.X, 210 + e.Y, y + 150 - e.X, (x) + 210 - e.Y)
graph.DrawLine(New Pen(Color.Orange, 1), 160 + e.X, 220 + e.Y, (y) + 160 - e.X, (x) + 220 - e.Y)
graph.DrawLine(New Pen(Color.Orange, 1), 170 + e.X, 230 + e.Y, y + 170 - e.X, (x) + 230 - e.Y)
graph.DrawLine(New Pen(Color.Orange, 1), 180 + e.X, 240 + e.Y, (y) + 180 - e.X, (x) + 240 - e.Y)
graph.DrawLine(New Pen(Color.Orange, 1), 210 + e.X, 150 + e.Y, y + 210 - e.X, (x) + 150 - e.Y)
graph.DrawLine(New Pen(Color.Orange, 1), 220 + e.X, 160 + e.Y, (y) + 220 - e.X, (x) + 160 - e.Y)
graph.DrawLine(New Pen(Color.Orange, 1), 230 + e.X, 170 + e.Y, y + 230 - e.X, (x) + 170 - e.Y)
graph.DrawLine(New Pen(Color.Orange, 1), 240 + e.X, 180 + e.Y, (y) + 240 - e.X, (x) + 180 - e.Y)
graph.DrawLine(New Pen(Color.Green, 1), 210 + e.X, 150 + e.Y, 150 + e.X, 210 + e.Y)
graph.DrawLine(New Pen(Color.Green, 1), 220 + e.X, 160 + e.Y, 160 + e.X, 220 + e.Y)
graph.DrawLine(New Pen(Color.Green, 1), 230 + e.X, 170 + e.Y, 170 + e.X, 230 + e.Y)
graph.DrawLine(New Pen(Color.Green, 1), 240 + e.X, 180 + e.Y, 180 + e.X, 240 + e.Y)
graph.DrawLine(New Pen(Color.Green, 1), y + 210 - e.X, (x) + 150 - e.Y, y + 150 - e.X, (x) + 210 - e.Y)
graph.DrawLine(New Pen(Color.Green, 1), (y) + 220 - e.X, (x) + 160 - e.Y, (y) + 160 - e.X, (x) + 220 - e.Y)
graph.DrawLine(New Pen(Color.Green, 1), y + 230 - e.X, (x) + 170 - e.Y, y + 170 - e.X, (x) + 230 - e.Y)
graph.DrawLine(New Pen(Color.Green, 1), (y) + 240 - e.X, (x) + 180 - e.Y, (y) + 180 - e.X, (x) + 240 - e.Y)
PictureBox1.Image = bm
End Sub
는 마우스 이동 라인을 회전 할 때 여기 내 묻고는 didnt한다 스트레칭 및 그리기 개체 만들고 싶어하고 회전 :여기에서 회전, 이동, 그리기 및 확대/축소가 잘못되었습니다.
Private Sub PictureBox1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseMove
PictureBox1.Refresh()
Dim graph As Graphics = PictureBox1.CreateGraphics
Dim rad As Double
Dim angle As Integer
rad = angle * System.Math.PI/180
Dim x As Integer = System.Math.Sin(rad) - System.Math.Cos(rad)
Dim y As Integer = System.Math.Sin(rad) + System.Math.Cos(rad)
Dim z As Integer = System.Math.Cos(rad) + System.Math.Sin(rad)
graph.DrawLine(New Pen(Color.Green, 1), e.X, e.Y, x + 200 - e.X, (y) + 400 - e.Y)
graph.DrawLine(New Pen(Color.Red, 1), e.X, e.Y, (y) + 400 - e.X, (z) + 200 - e.Y)
graph.DrawLine(New Pen(Color.Blue, 1), e.X, e.Y, z + 400 + e.X, x + 200 - e.Y)
graph.DrawLine(New Pen(Color.Orange, 1), 150 + e.X, 210 + e.Y, y + 150 - e.X, (x) + 210 - e.Y)
graph.DrawLine(New Pen(Color.Orange, 1), 160 + e.X, 220 + e.Y, (y) + 160 - e.X, (x) + 220 - e.Y)
graph.DrawLine(New Pen(Color.Orange, 1), 170 + e.X, 230 + e.Y, y + 170 - e.X, (x) + 230 - e.Y)
graph.DrawLine(New Pen(Color.Orange, 1), 180 + e.X, 240 + e.Y, (y) + 180 - e.X, (x) + 240 - e.Y)
graph.DrawLine(New Pen(Color.Orange, 1), 210 + e.X, 150 + e.Y, y + 210 - e.X, (x) + 150 - e.Y)
graph.DrawLine(New Pen(Color.Orange, 1), 220 + e.X, 160 + e.Y, (y) + 220 - e.X, (x) + 160 - e.Y)
graph.DrawLine(New Pen(Color.Orange, 1), 230 + e.X, 170 + e.Y, y + 230 - e.X, (x) + 170 - e.Y)
graph.DrawLine(New Pen(Color.Orange, 1), 240 + e.X, 180 + e.Y, (y) + 240 - e.X, (x) + 180 - e.Y)
graph.DrawLine(New Pen(Color.Green, 1), 210 + e.X, 150 + e.Y, 150 + e.X, 210 + e.Y)
graph.DrawLine(New Pen(Color.Green, 1), 220 + e.X, 160 + e.Y, 160 + e.X, 220 + e.Y)
graph.DrawLine(New Pen(Color.Green, 1), 230 + e.X, 170 + e.Y, 170 + e.X, 230 + e.Y)
graph.DrawLine(New Pen(Color.Green, 1), 240 + e.X, 180 + e.Y, 180 + e.X, 240 + e.Y)
graph.DrawLine(New Pen(Color.Green, 1), y + 210 - e.X, (x) + 150 - e.Y, y + 150 - e.X, (x) + 210 - e.Y)
graph.DrawLine(New Pen(Color.Green, 1), (y) + 220 - e.X, (x) + 160 - e.Y, (y) + 160 - e.X, (x) + 220 - e.Y)
graph.DrawLine(New Pen(Color.Green, 1), y + 230 - e.X, (x) + 170 - e.Y, y + 170 - e.X, (x) + 230 - e.Y)
graph.DrawLine(New Pen(Color.Green, 1), (y) + 240 - e.X, (x) + 180 - e.Y, (y) + 180 - e.X, (x) + 240 - e.Y)
End Sub
나는 VB로 질문 태그가 있지만 그게 맞는지 확실하지 않습니다. 그래서 선택적으로 ['edit the post'] (http://stackoverflow.com/posts/20746140/edit) 적절한 태그를 사용할 수 있습니까? 어쨌든, 당신의 게시물은별로 의미가 없습니다. 세부 사항에서 무엇이 잘못되었는지 설명해야합니다. 기대되는 결과와 실제로 무엇을 보았습니까? 감사! – TLama
@tlama : 네, VB.NET처럼 보입니다. VB.NET의 텍스트 벽. – Neolisk
@Neolisk, phew :-) 나는 형식화를 너무 많이 부수 지 않았 으면 좋겠다. – TLama