Quantcast
Viewing all articles
Browse latest Browse all 3852

Shape coordenates

Is there a reason why X,Y coordinates on 2D objects are the object center and in Graphics the X, Y are the coordinates of the top-left corner?

Image may be NSFW.
Clik here to view.
image

Canvas 1

Sub Paint(g As Graphics, areas() As Rect) Handles Paint
  g.DrawRectangle(0,0,Me.Width,Me.Height)
  g.DrawingColor=Color.Gray
  g.FillRectangle(30,30,30,30)
End Sub

Canvas 2

Sub Paint(g As Graphics, areas() As Rect) Handles Paint
  g.DrawRectangle(0,0,Me.Width,Me.Height)
  
  Var px As New RectShape
  px.Height=30
  px.Width=30
  px.x = 30
  px.y = 30
  px.FillOpacity=50
  g.DrawObject(px)
End Sub

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 3852

Trending Articles