Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages | Examples

WhipExamples/Viewport.cpp

#include "whiptk/whip_toolkit.h"

extern WT_File whip_file; //Assume this has been opened for writing elsewhere.

WT_Result Viewport()
{
    //Store the current viewport.
    WT_Viewport previous_viewport = whip_file.desired_rendition().viewport();
    //Define a set of coordinates to use for the new viewport to use.
    WT_Logical_Point vP[4];
    vP[0] = WT_Logical_Point(-100,-100);
    vP[1] = WT_Logical_Point(-100,100);
    vP[2] = WT_Logical_Point(100,100);
    vP[3] = WT_Logical_Point(100,-100);
    WT_Contour_Set boundary(whip_file, 4, vP);
    //Set the new viewport active.
    whip_file.desired_rendition().viewport() = WT_Viewport (whip_file, "Clip", boundary);
    //Draw some geometry (e.g. polylines, an image, etc.) which should be clipped in the viewport.
    //...
    //Restore the previous viewport.
    whip_file.desired_rendition().viewport() = previous_viewport;

    return WT_Result::Success;
}

Generated on Tue May 17 12:38:50 2005 for Autodesk DWF Toolkit by  doxygen 1.4.1