Method XbpPresSpace():create() Foundation

Creates a presentation space for a device context.

Syntax
:create( [<oDevice>]  , ;
         [<aPageSize>], [<nUnits>] ) --> self
Parameters
<oDevice>
The optional parameter <oDevice> can be used to specify a device context such as an XbpPrinter() or XbpMetaFile() object, or the return value of the :winDevice() method of Xbase Parts can be used. This allows the presentation space to be linked to the device context when it is created. If <oDevice> is not specified, the presentation space is not linked with any device context.
<aPageSize> := { nXsize, nYsize }
The parameter <aPageSize> determines the page size of the presentation space. <aPageSize> is an array of two elements that specifies the dimensions of the page in the x and y direction (X = width, Y = height). The page size depends on the unit <nUnits> of the coordinate system. The origin of the coordinate system( the point {0,0}) is the lower left corner of the page.
<nUnits>
The <nUnits> parameter optionally sets the unit for the coordinate system of the presentation space. The default unit is pixel. To define a different unit, a #define constant must be passed for <nUnits>. The following table lists the valid constants for <nUnits>.
Constants for coordinate system units
Constant Description
GRA_PU_ARBITRARY Any unit. The coordinate system is scaled to the viewport.
GRA_PU_PIXEL *) Unit is a pixel
GRA_PU_LOMETRIC Unit is 0.1 millimeter
GRA_PU_HIMETRIC Unit is 0.01 millimeter
GRA_PU_LOENGLISH Unit is 0.01 inch
GRA_PU_HIENGLISH Unit is 0.001 inch
GRA_PU_TWIPS Unit is 1/1440 inch
  1. Default value
Return

This method returns the object executing the method (self).

Description

The :create() method requests a presentation space from the operating system. Graphic output can occur using the XbpPresSpace object only after this method is executed. If the parameter <oDevice> is not specified, output can occur in the presentation space, but it is not visible. Graphic output is only visible if the presentation space is linked to a device context.

If the <aPageSize> parameter is not specified, the page is dimensioned to the size of the device context. In this case, the page has the same size like the view port. The page size can also be defined using the method :setPageSize().

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.