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

WhipExamples/DashPattern.cpp

#include "whiptk/whip_toolkit.h"

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

WT_Result DashPattern()
{
    //Define the pattern, pairs of values: dash length and gap length.
        int i, x=0, y=0;
    WT_Integer16 vN[12];
    for (i=0; i<6; i+=2)  //. . . dot dot dot
    {   vN[i] = 1;        //dash length
        vN[i+1] = 15;     //gap length
    }
    for (i=6; i<12; i+=2) //-- -- -- dash dash dash
    {   vN[i] = 15;       //dash length
        vN[i+1] = 15;     //gap length
    }
    //Store the previous dash pattern.
    WT_Dash_Pattern previous_pattern = whip_file.desired_rendition().dash_pattern();
    //Set the new dash pattern.
    WT_Dash_Pattern pattern( WT_Line_Pattern::Count+100/*ID*/, 12/*num values*/, vN);
    whip_file.desired_rendition().dash_pattern() = pattern;
    //Define some geometry using the dash pattern.
    WT_Logical_Point vP[2];
    vP[0].m_x = x;
    vP[0].m_y = vP[1].m_y = y-50;
    vP[1].m_x = x+500;
    WT_Polyline pline(2, vP, WD_False);
    //Serialize it.
    WD_CHECK(pline.serialize(whip_file));
    //Restore the previous dash pattern.
    whip_file.desired_rendition().dash_pattern() = previous_pattern;

    return WT_Result::Success;
}

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