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

WhipExamples/Color.cpp

#include "whiptk/whip_toolkit.h"

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

WT_Result Color()
{
    int x=0,y=0;
    //Set the rendition color from a new color object.
    whip_file.desired_rendition().color() = WT_Color (255,255,255);
    //Create some geometry.
    WT_Logical_Point vP[3];
    vP[0] = WT_Logical_Point(x, y);
    vP[1] = WT_Logical_Point(x+50, y+50);
    WT_Polyline p = WT_Polyline(2, vP, WD_True);
    //Serialize it.
    WD_CHECK(p.serialize (whip_file));

    //Use the color at index zero of the current color map.
    whip_file.desired_rendition().color() = whip_file.desired_rendition().color_map().map(0);
    //Create some geometry.
    vP[0] = WT_Logical_Point(x, y+100);
    vP[1] = WT_Logical_Point(x+50, y+150);
    p = WT_Polyline(2, vP, WD_True);
    //Serialize it.
    WD_CHECK(p.serialize (whip_file));

    return WT_Result::Success;
}

Generated on Tue May 17 12:07:43 2005 for Autodesk DWF Whip 2D Toolkit by  doxygen 1.4.1