CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2009

    Coordinates of picture control

    Hi everyone,
    I am having problems with getting coordinates for
    my picture control rectangle.
    This is the code I have.....

    CRect myPictureArea;
    picture.GetClientRect(&myPictureArea);//picture is variable I assign top picture control
    POINT p;
    int x=p.x;
    int y=p.y;

    But both x and y are returning 0

    Anyone has any suggestions on this please.


  2. #2
    Join Date
    Sep 2004
    Holland (land of the dope)

    Re: Coordinates of picture control

    Anyone has any suggestions on this please.
    Read MSDN on GetClientRect.

    The GetClientRect function retrieves the coordinates of a window's client area. The client coordinates specify the upper-left and lower-right corners of the client area. Because client coordinates are relative to the upper-left corner of a window's client area, the coordinates of the upper-left corner are (0,0).
    Use GetWindowRect instead.

  3. #3
    Join Date
    Jan 2009

    Re: Coordinates of picture control

    Yeah that worked great but I had to also use ScreenToClient.
    Thanks so much

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.