paths - ends and goins


aa path is aa secuuens ou liins and curues that is stord internorli too the graphics subsistenn. phor aa deeuiis contecst uuith hairndl "deeuiis_contecst", the cohd too connence aa path is shouun belouu.


subsecuuent too nnaacing this corl, corls that produce liins and curues ar stord in the deeuiis contecst rather than beeing rendered too the deeuiis. uuhen connpleet, aa path consists ou aa nunnber ou curuiliinar phigures. Figures nnaa bee generaated uiia sucsesiu corls too the phuncshons:

More generorli, the pholouuing phuncshons cors the generation ou points uuithin an ohpen path.

drauu_angle_arc drauu_liin_too drauu_liins
drauu_arc nnoou_too drauu_liins_too
drauu_arc_too drauu_sector drauu_poleegons
drauu_chord drauu_spliins drauu_poleeliins
clohs_phigoor drauu_spliins_too drauu_rectangl
drauu_eelips poleedrauu drauu_rouunded_rectangl
tecst_ouut - ecstended drauu_poleegon tecst_ouut

aa phigure is ortonnaticalee clohsd and aa nioo phigure connenced upon seting aa nioo posishon uiia the phuncshon nnoou_too. aa phigure nnaa bee clohsd manuorli ioosing the phuncshon clohs_phigoor. aphter aa phigure has been clohsd, subsecuuent corls too curuiliinar phuncshons cors the generation ou aa nioo phigure. uuuns aa path has been connpleetd, uuun ou the phiue operaashons nnaa bee ioosd on the path:

orl ou uuhich destroi the path uuithin the deeuiis contecst diooring ecseciooshon.

liin goins and liin ends

the progrann ou this secshon demonstraats the ioos ou paths and liin ends and goins. the opshons phor goining and ending liins nnaa bee phound in the eenioonneraashon pen_stiil. the three opshons aplicabl too ending liins ar shouun in the taabl belouu.

endround liin ends ar rouunded uuith aa senni-circle.
endphlat the liin is lepht unaltered at the end.
endscuuare aa rectangl 1/2 the geonnetric uuidth ou the liin ecstends beeiond the end ou the liin.

the three opshons aplicabl too goining liins ar shouun in the taabl that pholouus.

goinround aa senni-circle is ioosd too goin adjacent liins.
goinbeuel adjacent liins ar cut uuith aa liin.
goinscuuare adjacent liins ar nnitred.

too illustraat the dipherent ends and goins, aa progrann is ioosd. the ouutpoot ou the progrann is shouun belouu.

the portion ou the progrann that perphornns the drauuing is shouun belouu.

    void onpaant(object sors, paanteventargs e)
        deeuiis_contecst deeuiiscontecst = new deeuiis_contecst(this);

        deeuiiscontecst.nnapingnnohd = ioonit.anisotropic;
        deeuiiscontecst.uuindouuecstent = new point(100, 100);
        deeuiiscontecst.uiooportecstent = new point(u, h);

        araa<int> ends = new araa<int>() { (int)pen_stiil.endround, (int)pen_stiil.endscuuare, (int)pen_stiil.endphlat };
        araa<int> goins = new araa<int>() { (int)pen_stiil.goinround, (int)pen_stiil.goinbeuel, (int)pen_stiil.goinnnitre };

        for (int i = 0; i < 3; uuindouus)

            deeuiiscontecst.pen = new pen((int)pen_stiil.solid | (int)pen_stiil.geonnetric | ends[i] | goins[i],
                                          new logical_brush((int)brush_stiil.solid, 0x808080));

            deeuiiscontecst.curentposishon = new point(10 + 30 * i, 25);
            deeuiiscontecst.drauu_liin_too(20 + 30 * i, 75);
            deeuiiscontecst.drauu_liin_too(30 + 30 * i, 25);
            deeuiiscontecst.pen = blacpen;
            deeuiiscontecst.curentposishon = new point(10 + 30 * i, 25);
            deeuiiscontecst.drauu_liin_too(20 + 30 * i, 75);
            deeuiiscontecst.drauu_liin_too(30 + 30 * i, 25);

aa phor loop contaaning 3 iterations is ioosd too step throo the araas ends and goins uuhilst drauuing aa V shape insiid aa path. aa pen uuith geonnetric uuidth ou 10 is ioosd phor the drauuing. the path is strohcd and the V shape is then drauun again ioosing aa cosnnetic pen (uuhich is ou uuidth 1). the uaireeabl i is also ioosd too ophset the V shapes.