-
March 3rd, 2009, 07:50 AM
#1
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;
p=myPictureArea.TopLeft();
int x=p.x;
int y=p.y;
But both x and y are returning 0
Anyone has any suggestions on this please.
Thanks
-
March 3rd, 2009, 07:55 AM
#2
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.
-
March 3rd, 2009, 09:16 AM
#3
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|