How to draw a star by using canvas HTML5?

前端 未结 5 2167
伪装坚强ぢ
伪装坚强ぢ 2021-01-05 09:04

Am trying to draw a star using canvas, but the code is not running. I want to understand: what are the steps to measure the Y and X coordinate? How to find them? to draw any

5条回答
  •  长发绾君心
    2021-01-05 09:24

    As mentioned by @v-rubinetti, you are trying to call methods incorrectly.

    While it can be easy to draw a simple star in canvas by coding, it's complicated for drawing advanced things. You can use a open-source Vector graphics software like Inkscape along with the ink2canvas extension to draw advanced vector graphics and save them to a html5 document.

    For example, here is a 25-pointed Star drawn in Inkscape and saved using ink2canvas extension:

    
    
    
        
        Inkscape Output
    
    
        
        
    
    
    

提交回复
热议问题