{"id":773,"date":"2022-10-07T11:46:29","date_gmt":"2022-10-07T02:46:29","guid":{"rendered":"https:\/\/www.fsquare.co.kr\/?p=773"},"modified":"2024-11-12T12:52:02","modified_gmt":"2024-11-12T03:52:02","slug":"nativescript-vue-camera-%ec%b6%94%ea%b0%80","status":"publish","type":"post","link":"https:\/\/www.fsquare.co.kr\/?p=773","title":{"rendered":"Nativescript-vue Camera \ucd94\uac00"},"content":{"rendered":"\r\n<p>Camera\ub97c \uc0ac\uc6a9\ud558\uae30 \uc704\ud574 \ud504\ub85c\uc81d\ud2b8 \ud3f4\ub354\uc5d0\uc11c @nativescript\/camera\ub97c \ucd94\uac00<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\">C:\\project\\vue&gt; cd myFarm  \/\/ &lt;=== \ud3f4\ub354\uad6c\uc870\uac00 C:\\project\\vue\uc778 \uacbd\uc6b0\r\nC:\\project\\vue\\myFarm&gt; ns  plugin  add  @nativescript\/camera<\/pre>\r\n\r\n\r\n\r\n<p>npm \uba85\ub839\uc73c\ub85c nativescript-camera\ub9cc \ucd94\uac00\ud558\uace0 buil\ub97c \ud588\ub354\ub2c8 build \uc5d0\ub7ec\ub3c4 \ubc1c\uc0dd\ud558\uace0 Android emulator\uc5d0 \uc800\uc7a5\ud560 \uacf5\uac04\uc774 \uc5c6\ub2e4\ub294 \uc5d0\ub7ec\ub3c4 \ubc1c\uc0dd\ud55c\ub2e4. Android \ud578\ub4dc\ud3f0(\uc0bc\uc131 \uac24\ub7ed\uc2dc\ub098 \uad6c\uae00 Pixel \uac19\uc740)\uc744 \uc5f0\uacb0\ud574\uc11c \uac1c\ubc1c\ud558\uac70\ub098 Android Studio\uc758 More Action &gt; Virtual Device Manager\uc5d0\uc11c \uac00\uc0c1\uba38\uc2e0\uc758 \uc624\ub978\ucabd \ub05d \uba54\ub274\ub97c \ub20c\ub7ec Wipe Data\ub97c \uc2e4\ud589\uc2dc\ud0a8 \ub2e4\uc74c \ub2e4\uc2dc \ud14c\uc2a4\ud2b8 \ud55c\ub2e4.<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.fsquare.co.kr\/wp-content\/uploads\/2022\/10\/image.png\"><img loading=\"lazy\" decoding=\"async\" width=\"865\" height=\"327\" class=\"wp-image-778\" src=\"https:\/\/www.fsquare.co.kr\/wp-content\/uploads\/2022\/10\/image.png\" alt=\"\" srcset=\"https:\/\/www.fsquare.co.kr\/wp-content\/uploads\/2022\/10\/image.png 865w, https:\/\/www.fsquare.co.kr\/wp-content\/uploads\/2022\/10\/image-300x113.png 300w, https:\/\/www.fsquare.co.kr\/wp-content\/uploads\/2022\/10\/image-768x290.png 768w\" sizes=\"auto, (max-width: 865px) 100vw, 865px\" \/><\/a><\/figure>\r\n\r\n\r\n\r\n<p>Wipe Data \ud6c4\uc5d0 \ub2e4\uc2dc ns run android\ub97c \uc2e4\ud589\ud558\uba74 \uae30\uacc4\uc758 \uc800\uc7a5\uacf5\uac04\uc774 \ubd80\uc871\ud558\ub2e4\ub294 \uba54\uc2dc\uc9c0\uac00 \uc548\ub098\uc628\ub2e4. \ub9cc\uc57d \uacc4\uc18d \uac19\uc740 \uacf5\uac04 \ubd80\uc871 \uba54\uc2dc\uc9c0\uac00 \ub098\uc628\ub2e4\uba74 \uc124\uc815\uc73c\ub85c \ub4e4\uc5b4\uac00\uc11c \uc800\uc7a5\uacf5\uac04\uc744 \ub298\ub824\uc918\uc57c \ud55c\ub2e4.<\/p>\r\n\r\n\r\n\r\n<p>\uc124\uce58\ub41c plugin\uc744 \ubcf4\uba74 \ub2e4\uc74c\uacfc \uac19\ub2e4.<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\">C:\\project\\vue\\myFarm&gt; npm  list\r\n\r\nmyFarm@1.0.0 C:\\Project\\Vue\\myFarm\r\n+-- @nativescript\/android@8.3.1\r\n+-- @nativescript\/camera@5.0.13\r\n+-- @nativescript\/core@8.3.5\r\n+-- @nativescript\/preview-cli@1.0.1\r\n+-- @nativescript\/theme@3.0.2\r\n+-- @nativescript\/webpack@5.0.8\r\n+-- nativescript-camera@4.5.0\r\n+-- nativescript-vue-template-compiler@2.9.3\r\n`-- nativescript-vue@2.9.3\r\n<\/pre>\r\n\r\n\r\n\r\n<p>@nativescript\/camera\ub97c import\ud558\uace0 Camera \uc0ac\uc6a9 \ubaa8\ub4c8\uc744 \ucd94\uac00<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\">&lt;template&gt;\r\n...\r\n      &lt;StackLayout&gt;\r\n          &lt;Image :src=\"img\" width=\"100%\" \/&gt;\r\n      &lt;\/StackLayout&gt;\r\n...\r\n&lt;\/template&gt;\r\nimport * as camera from '@nativescript\/camera';\r\n...\r\nexport default {\r\n    data() {\r\n        return {\r\n            img:''\r\n        }\r\n    },\r\n    methods:{\r\n        takePicture() {\r\n            camera.requestCameraPermissions()\r\n                .then(() =&gt; {\r\n                    camera.takePicture({ width: 300, height: 300, keepAspectRatio: true, saveToGallery: false })\r\n                    .then(imageAsset =&gt; {\r\n                        this.img = imageAsset;\r\n                    })\r\n                    .catch(e =&gt; {\r\n                        console.log('error:', e);\r\n                    });\r\n                })\r\n                .catch(e =&gt; {\r\n                    console.log('Error requesting permission');\r\n                });\r\n            }\r\n        }<\/pre>\r\n\r\n\r\n\r\n<p>camera.takePicture\uc5d0 \uc758\ud574 \uc0ac\uc9c4\uc774 \ucc0d\ud788\uba74 this.img \uac00 update\ub418\uace0, \uc790\ub3d9\uc73c\ub85c Image\uc758 src\uac00 update\ub41c\ub2e4.<\/p>\r\n","protected":false},"excerpt":{"rendered":"<p>Camera\ub97c \uc0ac\uc6a9\ud558\uae30 \uc704\ud574 \ud504\ub85c\uc81d\ud2b8 \ud3f4\ub354\uc5d0\uc11c @nativescript\/camera\ub97c \ucd94\uac00 C:\\project\\vue&gt; cd myFarm \/\/ &lt;=== \ud3f4\ub354\uad6c\uc870\uac00 C:\\project\\vue\uc778 \uacbd\uc6b0 C:\\project\\vue\\myFarm&gt; ns plugin add @nativescript\/camera npm \uba85\ub839\uc73c\ub85c nativescript-camera\ub9cc \ucd94\uac00\ud558\uace0 buil\ub97c \ud588\ub354\ub2c8 build \uc5d0\ub7ec\ub3c4 \ubc1c\uc0dd\ud558\uace0 Android emulator\uc5d0 \uc800\uc7a5\ud560 \uacf5\uac04\uc774 \uc5c6\ub2e4\ub294 \uc5d0\ub7ec\ub3c4 \ubc1c\uc0dd\ud55c\ub2e4. Android \ud578\ub4dc\ud3f0(\uc0bc\uc131 \uac24\ub7ed\uc2dc\ub098 \uad6c\uae00 Pixel \uac19\uc740)\uc744 \uc5f0\uacb0\ud574\uc11c \uac1c\ubc1c\ud558\uac70\ub098 Android Studio\uc758 More Action &gt; Virtual Device Manager\uc5d0\uc11c \uac00\uc0c1\uba38\uc2e0\uc758 \uc624\ub978\ucabd \ub05d [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36,28],"tags":[],"class_list":["post-773","post","type-post","status-publish","format-standard","hentry","category-nativescript","category-vue"],"_links":{"self":[{"href":"https:\/\/www.fsquare.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/773","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.fsquare.co.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.fsquare.co.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.fsquare.co.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fsquare.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=773"}],"version-history":[{"count":9,"href":"https:\/\/www.fsquare.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/773\/revisions"}],"predecessor-version":[{"id":1011,"href":"https:\/\/www.fsquare.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/773\/revisions\/1011"}],"wp:attachment":[{"href":"https:\/\/www.fsquare.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=773"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fsquare.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=773"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fsquare.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=773"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}