Thursday, May 23, 2013
 
    Search Web Link
Search Software
    
API Home » Rectangle » UnionRect

UnionRect

Category: Rectangle
Hits: 3306 Rating: UnionRect has been rated 2.42 by  1044 users (2.42) votes 1044
Rate: 1-star  2-stars  3-stars  4-stars  5-stars
E-mail this API to friend E-mail this Code to a friend  save Bookmark this VB API Function
API Explanation
UnionRect determines the smallest possible rectangle that contains two other rectangles. This rectangle is called the union rectangle because it is derived from the union of the areas that the two source rectangles occupy. The union rectangle is put into the variable passed as lpDestRect. The function returns 0 if an error occured, or 1 if successful.

Parameter Information
Declare Function UnionRect Lib "user32.dll" (lpDestRect As _
RECT, lpSrc1Rect As RECT, lpSrc2Rect As RECT) As Long

lpDestRect
Variable that receives the union rectangle.
lpSrc1Rect
The first of the two source rectangles.
lpSrc2Rect
The second of the two source rectangles.
Code



' Create a large rectangle that contains the areas occupied by
' rectangles s and t. The new rectangle will fully contain both smaller rectangles.
' s = (20,30)-(60,80); t = (100,110)-(200,300)
Dim s As RECT, t As RECT ' small rectangles
Dim urect As RECT ' receives the union rectangle
Dim retval As Long ' return value

' Set the small rectangles
retval = SetRect(s, 20, 30, 60, 80) ' set s = (20,30)-(60,80)
retval = SetRect(t, 100, 110, 200, 300) ' set t = (100,110)-(200,300)

' Figure out the union rectangle
retval = UnionRect(urect, s, t) ' now urect = (20,30)-(200,300)





HOME | MUSIC | DOWNLOADS |  GAMES | TEST-QUIZZES | SITEMAP | ABOUT | HELP
Copyright © 2000 - 2013 Ex-designz. All rights reserved. Website Developed By Dexter Zafra of Myasp-net.com
Link to us | Advertisement | Contact us | Privacy Policy | Terms of use | Accessibility