Skip to content

How do I find a screen point of a Graphics object?

gemtraveller

Asked Mar 12, 2005, 4:19 AM EST5 answers
Share
LinkedInX
I can measure the wdth and height of my graphics object but how would I be able to find a point in it related to the screen?

5 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    Hi, I be able to find a point in it related to the screen? --> point related to screen??? what do you mean by that? Do you mean like a square with 4 points? What is the x,y for each points? Please elaborate more so i can help. Cheers.
    0
  • 0
    I want to find the center of a Graphics object. "Related to screen" meaning not the width or height but in screen coordinates.
    0
  • 0
    I am trying this right now but doesn't seem to work. rectCenterX = rect.Bottom - rect.Top; rectCenterY = rect.Right - rect.Left;
    0
  • 0
    Sorry, like this: RectangleF rect = grfx.ClipBounds; rectCenterX = rect.Bottom - rect.Top; rectCenterY = rect.Right - rect.Left;
    0
  • 0
    Hi, I am not really a Matematical person. But i think below does help you in somehow to writer a Math helper class. http://www.gotdotnet.com/Community/MessageBoard/Thread.aspx?id=272534 Look at the 2nd and 3rd post. Hope it helps. Cheers.
    0