Vector graphics flood fill algorithms?

后端 未结 3 386
旧巷少年郎
旧巷少年郎 2020-12-31 07:44

I am working on a simple drawing application, and i need an algorithm to make flood fills.
The user workflow will look like this (similar to Flash CS, just more simpler)

3条回答
  •  猫巷女王i
    2020-12-31 08:43

    With ActionScript you can use beginFill and endFill, e.g.

    pen_mc.beginFill(0x000000,100);
    pen_mc.lineTo(400,100);
    pen_mc.lineTo(400,200);
    pen_mc.lineTo(300,200);
    pen_mc.lineTo(300,100);
    pen_mc.endFill();
    

    http://www.actionscript.org/resources/articles/212/1/Dynamic-Drawing-Using-ActionScript/Page1.html

    Flash CS4 also introduces support for paths:

    http://www.flashandmath.com/basic/drawpathCS4/index.html

    If you want to get crazy and code your own flood fill then Wikipedia has a decent primer, but I think that would be reinventing the atom for these purposes.

提交回复
热议问题