DeviceContext

 

Contents

Name

DeviceContext

Remark

The DeviceContext class defines a class of device-context objects.

Hierarchy

Examples

EX1

int DeviceContext_ex1()
{
    Page pb;
    pb = Project.Pages(); // Get the project's active page
    if( pb.IsValid() )
    {
        Window    myWindow = pb.GetWindow();
        DeviceContext myDC = myWindow.GetDC();
        int nPixels = myDC.GetDeviceCaps(LOGPIXELSX);
    }
    return 1;
}

header to Include

origin.h

Reference

Members

Name Brief Example
~DeviceContext Reconstruct a DeviceContext object.
Attach Use hDC set internal hDC value. Examples
Detach Return internal hDC value of class and set internal hDC to NULL Examples
DeviceContext Default constructor for a DeviceContext object. Examples
GetDeviceCaps This method retrieves a wide range of device-specific information about the display device. Examples
GetTextExtent Computes the width and height of a line of text on the attribute device context using the current font to determine the dimensions. Examples