The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: Mark_201 on June 14, 2006, 10:30:00 PM

Title: draw in a dialog Image control
Post by: Mark_201 on June 14, 2006, 10:30:00 PM
I have an Image window ( or control?)  in a dialog box.  I know how to get the handle of it but how do I get the rectangle size or coordinates so I can draw lines using LineTo?  Is there an example how to do this?

Title: Re: draw in a dialog Image control
Post by: Casper on June 14, 2006, 11:55:02 PM
Casper says...

To understand this search the help file for Rectangle Coordinates

Title: Re: draw in a dialog Image control
Post by: Mark_201 on June 15, 2006, 12:31:04 AM
Quote from: Casper on June 14, 2006, 11:55:02 PM
Casper says...

To understand this search the help file for Rectangle Coordinates



:lol  Thanks for the laugh.
Title: Re: draw in a dialog Image control
Post by: Tedd on June 15, 2006, 01:15:27 AM
GetWindowRect ?
Title: Re: draw in a dialog Image control
Post by: Mark_201 on June 16, 2006, 12:15:55 PM
Quote from: Tedd on June 15, 2006, 01:15:27 AM
GetWindowRect ?
GetWindowRect - gets RECT coordinates relative to screen
GetClientRect    -  gets RECT coordinates relative to the client or itself (i.e.  width and height )

Title: Re: draw in a dialog Image control
Post by: Siekmanski on June 17, 2006, 08:15:17 AM
Maybe this is what you need ?

   invoke  GetClientRect,hwnd,addr rcScreen

   And then convert the client-area coordinates to screen coordinates:

   invoke  ClientToScreen,hwnd,addr rcScreen.left
   invoke  ClientToScreen,hwnd,addr rcScreen.right