Home

Applications Accessories: The Point

   

Introduction

To identify the concept of a point, the Win32 library provides the POINT structure. This structure is defined as follows:

typedef struct tagPOINT { 
	LONG x; 
	LONG y; 
} POINT, *PPOINT;
 

The first member, x, represents the horizontal distance of the point from the top-left corner of the object that owns the point. The y member represents the vertical measurement of the point with regards to the top-left corner of the object that owns the point.

Besides the Win32's POINT structure, the VCL provides a class that performs the same operations. It is called TPoint. It is defined as follows:

TPoint = record
	X: Integer;
	Y: Integer;
end;

As you can see, you can define or retrieve the position of a TPoint variable using its x and y values. Because it has a constructor, you can also declare it as a C++ variable.

 

 
 

Home Copyright © 2010 FunctionX, Inc.