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

FillPattern.cpp

#include "whiptk/whip_toolkit.h"

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

WT_Result FillPattern()
{
    //Store the current fill pattern.
    WT_Fill_Pattern previous_pattern = whip_file.desired_rendition().fill_pattern();
    //Set the fill pattern.
    whip_file.desired_rendition().fill_pattern() = WT_Fill_Pattern::Slant_Left;
    //Set the pattern scale.
    whip_file.desired_rendition().fill_pattern().pattern_scale() = .75;
    //Create a filled drawable (e.g. a polygon).
    int x=0,y=0;
    WT_Logical_Point vP[4];
    vP[0] = WT_Logical_Point(x, y);
    vP[1] = WT_Logical_Point(x+100, y);
    vP[2] = WT_Logical_Point(x+100, y+100);
    vP[3] = WT_Logical_Point(x, y+100);
    WT_Polygon pg1 (4, vP, WD_True);
    //Serialize it.
    WD_CHECK(pg1.serialize (whip_file));
    //Restore the previous pattern.
    whip_file.desired_rendition().fill_pattern() = previous_pattern;

    return WT_Result::Success;
}

Generated on Mon May 9 23:16:54 2005 for Autodesk DWF Toolkit by  doxygen 1.4.1