Javascript/jQuery: remove shape/path from canvas

前端 未结 8 1139
离开以前
离开以前 2021-02-19 05:34

I can\'t seem to find the function to remove a shape or path from the canvas after it has been created.

So I\'m creating a bezier curve between 2 points with

<         


        
8条回答
  •  一向
    一向 (楼主)
    2021-02-19 05:57

    This is an important thing to realise about . It's a flattened image made up of pixels. Once something's drawn to it, it's merged into the pixel grid and cannot be differentiated from the other pixels.

    If you need to be able to separate image elements you could:

    1. Overlay elements into a stack of layers
    2. Use in which each visual element is distinct from the other elements and may be manipulated independently

    You can think of as being a single layer in PhotoShop/Gimp/Fireworks, or an MSPaint document.

    You can think of as a document in Illustrator/InkScape.

提交回复
热议问题