example_canvas_dash.cpp

破線
破線のサンプルコード
canvas_dash.png

破線

void DlgSample::Draw(SGRect region)
{
    SGDialog::Draw(region);

    SGCanvasDraw cd( this );
    if( cd.CvBegin() ){

        int dashes[] = {50,10,10,10};
        int ndash = sizeof(dashes) / sizeof(dashes[0]);
        int offset = -50;

        cd.CvColor(0,0,0);
        cd.CvSetDash(dashes, ndash, offset);
        cd.CvSetLineWidth(10);

        cd.CvMoveTo(128, 25);
        cd.CvLineTo(230, 230);
        cd.CvLineToRel(-102, 0);
        cd.CvCurveTo(51, 230, 51, 128, 128, 128);
        cd.CvStroke();

        cd.CvEnd();
    }
}

PlusG リファレンスマニュアル Ver 2.0.0