OnRedraw center?

Topics: Windows Forms
Aug 2, 2012 at 8:35 PM



I have a custom polygon class, and I'm overriding the onredraw method. After trying to use several functions to determine the center of the polygon with "strange" results, I've noticed that, when I zoom in or out, the 0,0  coordinate of the graphis is the position where the mouse is. For example:


 Public Overrides Sub OnRender(ByVal g As Graphics) 
    g.DrawString("MESSAGE", Font, Brushes.Black, 0, 0)

 End Sub


That draws "message" on the mouse cursor position when I zoom in or out (when I drag the map the label stays on his relative position).

It's that behavior OK?



Aug 3, 2012 at 7:10 AM

coordinates are shifted in dynamic way, long story...

Aug 3, 2012 at 2:09 PM

Ok, thanks.


So, how do I get control coordinates? I mean, I need the local coordinates of the points of the polygons, but the localpoints collection of the polygon seem to work in the same way when I zoom in or out (same way=relative to the mouse position)...


Thank you