Regions?

Aviator
03-12-2002, 05:16 PM
In light of a lot of recent posts about using regions, can someone please explain a few things to me about them (all I know is there are a lot of these API calls, but I don't know their names). Can you guys please explain stuff like:

1) Where and for what are regions used.

2) Site or other place where I can get a tutorial on how to use them

3) Common API's that involve regions

I should note that I like VB graphic and game programming and this is why I am asking. Thanks for the help.

ChiefRedBull
03-13-2002, 03:36 AM
A region is merely an area defined by three or more points. The points are normally of the PointAPI type. Type POINTAPI
X As Integer
Y As Integer
End Type
You use them for collision detection, drawing routines, masking, shaped forms etc.
I think Hand has done a tutor on regions at www.elitevb.comCommon APIs? Search at www.AllAPI.net for "region".

Squirm
03-13-2002, 03:53 AM
A region is an area of something. They can be, as Chief said, defined by points, using the CreatePolygonRgn API, but they can be any shape you want. The ways of creating regions include:


Direct region creation:

CreateEllipticRgn
CreateEllipticRgnIndirect
CreatePolygonRgn
CreatePolyPolygonRgn
CreateRectRgn
CreateRectRgnIndirect
CreateRoundRectRgn

Creating regions from exisiting regions:

CombineRgn
InvertRgn
OffsetRgn


And uses include:


Custom shaped forms or controls (SetWindowRgn)
Collision detections (PtInRegion, RectInRgn, EqualRgn)
Creating invisible 'hot spots' to overlay on a picture, like imagemaps used on the web.
Drawing shapes (FrameRgn, FillRgn)


And probably much more........ :D

Aviator
03-13-2002, 08:59 AM
Aight thanks guys, looks like I'll be reading a bit for a few days.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum