{"id":1811,"date":"2020-04-02T06:10:00","date_gmt":"2020-04-01T21:10:00","guid":{"rendered":"https:\/\/www.itchefblog.com\/?p=1811"},"modified":"2021-04-22T02:53:05","modified_gmt":"2021-04-21T17:53:05","slug":"%ea%b7%b8%eb%9e%98%ed%94%bd-api-%eb%8b%a4%eb%a3%a8%ea%b8%b0","status":"publish","type":"post","link":"https:\/\/www.itchefblog.com\/?p=1811","title":{"rendered":"\uadf8\ub798\ud53d API \ub2e4\ub8e8\uae30"},"content":{"rendered":"\n<ul><li>Canvas : \ub3c4\ud654\uc9c0 (\ubdf0\uc758 \ud45c\uba74\u3134)<\/li><li>Paint : \ubd93 (\uc0c9, \uad75\uae30, \uc2a4\ud0c0\uc77c \uc815\uc758<\/li><\/ul>\n\n\n\n<p>\uba3c\uc800 \ucee4\uc2a4\ud140 \ubdf0\uc5d0 onDraw \uba54\uc11c\ub4dc\ub97c \uc624\ubc84\ub77c\uc774\ub4dc \ud574\uc11c Canvas \uac1d\uccb4\ub97c \ubc1b\ub294\ub2e4.<br>\uc5ec\uae30\uc11c \uc6d0\ud558\ub294 \uadf8\ub9bc\uc744 \uadf8\ub9ac\uba74 \ub41c\ub2e4.<\/p>\n\n\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\/\/\uadf8\ub9bc\uc744 \uadf8\ub9ac\ub824\uba74 \ub2e4\uc74c\uacfc \uac19\uc774...\n\/\/\uc6d0\uc744 \uadf8\ub9bd\ub2c8\ub2e4.\ndrawCircle(cx: Float, cy: Float, radius: Float, paint: Paint!) :\n\/\/cx : x\u00a0\uc88c\ud45c\n\/\/cy : y \uc88c\ud45c\n\/\/radius : \ubc18\uc9c0\ub984\n\/\/paint : Paint \uac1d\uccb4\n \n\/\/\uc120\uc744 \uadf8\ub9bd\ub2c8\ub2e4.\ndrawLine(staryX: Float, startY: Float, stopX: Float, stopY: Float, paint: Paint!) :\n\/\/startX : \ud55c \uc810\uc758 x \uc88c\ud45c\n\/\/startY : \ud55c \uc810\uc758 y \uc88c\ud45c\n\/\/stopX : \ub2e4\ub978 \uc810\uc758 x \uc88c\ud45c\n\/\/stopY : \ub2e4\ub984 \uc810\uc758 y \uc88c\ud45c\n\/\/paint : Paint \uac1d\uccb4\n\nclass TiltView(context: Context?) : View(context) {\n\t\tprivate val greenPaint: Paint = Paint()\n    private val blackPaint: Paint = Paint()\n\n    init {\n        \/\/\ub179\uc0c9 \ud398\uc778\ud2b8\n        greenPaint.color = Color.GREEN\n\n        \/\/\uac80\uc740\uc0c9 \ud14c\ub450\ub9ac \ud398\uc778\ud2b8\n        blackPaint.style = Paint.Style.STROKE\n    }\n\n    override fun onDraw(canvas: Canvas?) {\n\n        super.onDraw(canvas)\n    }\n\n}\n\n\/\/Paint\uac1d\uccb4\uc758 color \ubc0f style \uc744 \ubcc0\uacbd\ud560 \uc218 \uc788\ub530.\n\/\/color \ud504\ub85c\ud37c\ud2f0\uc758 \uae30\ubcf8\uac12\uc740 \uac80\uc740\uc0c9\uc774\uba70 \uc0c9\uc744 \ubcc0\uacbd\ud558\ub824\uba74 Color\ud074\ub798\uc2a4\uc5d0 \uc120\uc5b8\ub41c \uc0c9\uc0c1\ub4e4\uc744 \uc9c0\uc815\ud55c\ub2e4.\n\/\/style \ud504\ub85c\ud37c\ud2f0\ub294 \ub2e4\uc74c \uc18d\uc131 \uc911\uc5d0\uc11c \ud558\ub098\ub97c \uc120\ud0dd\ud55c\ub2e4.\n\/\/ - FILL : \uc0c9\uc744 \ucc44\uc6b4\ub2e4. \ud68d \uad00\ub828\ub41c \uc124\uc815\uc744 \ubb34\uc2dc\ud55c\ub2e4.\n\/\/ - FILL_AND_STROKE : \ud68d\uacfc \uad00\ub828\ub41c \uc124\uc815\uc744 \uc720\uc9c0\ud558\uba74\uc11c \uc0c9\uc744 \ucc44\uc6b4\ub2e4.\n\/\/ - STROKE : \ud68d \uad00\ub828 \uc124\uc815\uc744 \uc720\uc9c0\ud558\uc5ec \uc678\uacfd\uc120\ub9cc \uadf8\ub9b0\ub2e4.\n\/\/\uae30\ubcf8\uac12\uc740 FILL\uc774\uba70 \uc5ec\uae30\uc11c\ub294 \uc678\uacfd\uc120\ub9cc \uadf8\ub9ac\ubbc0\ub85c STROKE\ub97c \uc124\uc815.\n\n\n\/\/ onDraw()\ub97c \ub2e4\uc2dc \ud638\ucd9c, \uc989 \ubdf0\ub97c \ub2e4\uc2dc \uadf8\ub9bc\ninvalidate()\n<\/pre>","protected":false},"excerpt":{"rendered":"<p>Canvas : \ub3c4\ud654\uc9c0 (\ubdf0\uc758 \ud45c\uba74\u3134) Paint : \ubd93 (\uc0c9, \uad75\uae30, \uc2a4\ud0c0\uc77c \uc815\uc758 \uba3c\uc800 \ucee4\uc2a4\ud140 \ubdf0\uc5d0 onDraw \uba54\uc11c\ub4dc\ub97c \uc624\ubc84\ub77c\uc774\ub4dc \ud574\uc11c Canvas \uac1d\uccb4\ub97c \ubc1b\ub294\ub2e4.\uc5ec\uae30\uc11c \uc6d0\ud558\ub294 \uadf8\ub9bc\uc744 \uadf8\ub9ac\uba74 \ub41c\ub2e4.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[349,372,7,4],"tags":[],"_links":{"self":[{"href":"https:\/\/www.itchefblog.com\/index.php?rest_route=\/wp\/v2\/posts\/1811"}],"collection":[{"href":"https:\/\/www.itchefblog.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.itchefblog.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.itchefblog.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.itchefblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1811"}],"version-history":[{"count":1,"href":"https:\/\/www.itchefblog.com\/index.php?rest_route=\/wp\/v2\/posts\/1811\/revisions"}],"predecessor-version":[{"id":1812,"href":"https:\/\/www.itchefblog.com\/index.php?rest_route=\/wp\/v2\/posts\/1811\/revisions\/1812"}],"wp:attachment":[{"href":"https:\/\/www.itchefblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1811"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.itchefblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1811"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.itchefblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1811"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}