×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Reset Matrix Class no working

Reset Matrix Class no working

Reset Matrix Class no working

(OP)
I'm no native english speaker. I want to draw first figure rotated y second one, no. when I run code doesn't show first one and second one is rotated. reset is not working. No change order figures, it´s necesary draw them so.

````````````
Private Sub Form17_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
Dim x, y As Integer
e.Graphics.SmoothingMode = SmoothingMode.HighQuality
'Figure 1
Dim Mx As Matrix = New Matrix()
x = 59 : y = 25
Mx.RotateAt(90, New Point(x, y), MatrixOrder.Append)
e.Graphics.Transform = Mx
e.Graphics.DrawEllipse(New Pen(Color.Green, 1), New Rectangle(x + 3, y - 5, 10, 10))
e.Graphics.DrawLine(New Pen(Color.Green, 1), x, y - 2, x + 13, y - 2)
e.Graphics.DrawLine(New Pen(Color.Green, 1), x, y + 2, x + 13, y + 2)
e.Graphics.DrawLine(New Pen(Color.Green, 1), x + 8, y - 5, x + 8, y + 5)
Mx.Reset()
'Figura 2
e.Graphics.DrawEllipse(New Pen(Color.Blue, 1), New Rectangle(x + 3, y - 5, 10, 10))
e.Graphics.DrawLine(New Pen(Color.Blue, 1), x, y - 2, x + 13, y - 2)
e.Graphics.DrawLine(New Pen(Color.Blue, 1), x, y + 2, x + 13, y + 2)
e.Graphics.DrawLine(New Pen(Color.Blue, 1), x + 8, y - 5, x + 8, y + 5)
End Sub

````````````
what's wrong.........

thanks in advance


Nikolas

RE: Reset Matrix Class no working

Hi, this is another non English native speaker. I think I got your question, but I do not understand why you cannot start with the figure non rotated and then append the rotated one. Seems to me the more logical order? If its a problem, then set the rotated (second figure) as the reference and declare it first, you will rotate -90 degree on second step.

Anyway, I experienced issues with drawing refresh sometime ago.
So I used to draw inside panel, like this below, see if this can help you

Private Sub Panel1_Paint(sender As System.Object, e As System.Windows.Forms.PaintEventArgs) Handles Panel1.Paint
Dim myGraphics As Graphics = Panel1.CreateGraphics
Dim origin_y As Integer
Dim X_STEP, Y_STEP, X_STEP0 As Integer
Dim Zd As Integer
Dim MYPEN2 As Pen
'example
....

MYPEN2 = New Pen(Drawing.Color.Blue, 1)
MYPEN2.DashStyle = Drawing.Drawing2D.DashStyle.Solid

myGraphics.DrawLine(MYPEN2, X_STEP0, origin_y - Y_STEP - Zd, X_STEP, origin_y - Y_STEP - Zd)

....
End Sub

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login


Resources

Taking Control of Engineering Documents
This ebook covers tips for creating and managing workflows, security best practices and protection of intellectual property, Cloud vs. on-premise software solutions, CAD file management, compliance, and more. Download Now
The Great Project Profitability Debate
A/E firms have a great opportunity to lead the world into the future, but the industry’s greatest asset—real-time data—is sitting wasted in clunky, archaic ERP platforms. Learn how real-time, fully interactive dashboards in a modern ERP allow you to unlock data that will shape the future of the world. Download Now

Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close