Jump to content

  • Log In with Google      Sign In   
  • Create Account

GDI - how to get RECT from HRGN region


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 knos991   Members   -  Reputation: 112

Like
0Likes
Like

Posted 04 September 2014 - 09:34 AM

I'm new to GDI and I'm trying to figure out how to get a RECT object (with bottom,left,top,right coordinates in logical units) from a HRGN handle of the clipping region.

 

Is there a way to do this or am I getting something wrong in how to use them? 



Sponsor:

#2 Buckeye   Crossbones+   -  Reputation: 6313

Like
1Likes
Like

Posted 04 September 2014 - 01:08 PM

To answer your question directly: unfortunately, you can't. sad.png

 

FYI: RECT is not a GDI object, it's just a structure. HRGN is a GDI object, like pens and brushes.. In addition, a region can be more than a rectangle - it can be elliptical, a polygon and even combined with other regions with logical operators such as RGN_OR, RGN_AND, etc., to form a COMPLEXREGION.


Edited by Buckeye, 04 September 2014 - 01:09 PM.

Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.


#3 mark ds   Members   -  Reputation: 1481

Like
2Likes
Like

Posted 04 September 2014 - 01:18 PM

GetRgnBox()

 

MSDN

 

I used to write a LOT of Win32 code, and for the most part really like the way Windows works. However, I've always pathologically despised regions angry.png



#4 knos991   Members   -  Reputation: 112

Like
0Likes
Like

Posted 04 September 2014 - 02:27 PM

Thanks to both of you! Very much appreciated smile.png

 

Unfortunately this stuff is very poor documented, I should get a copy of Petzold's book I suppose. Thanks!



#5 Buckeye   Crossbones+   -  Reputation: 6313

Like
0Likes
Like

Posted 04 September 2014 - 03:03 PM


I should get a copy of Petzold's book I suppose.

 

Well.. I didn't find GetRgnBox in the 5th edition.  huh.png  But it's in the MS Help for Visual Studio, bigger than life. Thumbs up to mark ds for finding that.

 

EDIT: Having said that, it's an excellent book for the Windows API. It is not an encyclopedia for the API, but there are good compile-first-time examples for beginner-to-intermediate level.


Edited by Buckeye, 04 September 2014 - 03:17 PM.

Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS