{"id":2636,"date":"2025-11-11T13:13:59","date_gmt":"2025-11-11T06:13:59","guid":{"rendered":"https:\/\/portal-atlasx.cdg.co.th\/home\/?post_type=docs&#038;p=2636"},"modified":"2025-11-11T15:17:12","modified_gmt":"2025-11-11T08:17:12","slug":"image","status":"publish","type":"docs","link":"https:\/\/portal-atlasx.cdg.co.th\/home\/docs\/android\/library\/image\/","title":{"rendered":"Image"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\" id=\"imageutil\" style=\"font-style:normal;font-weight:600\">ImageUtil<\/h1>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"class-initialize\"><strong>Class Initialize<\/strong><\/h2>\n\n\n\n<p>\u0e01\u0e32\u0e23\u0e40\u0e23\u0e34\u0e48\u0e21\u0e15\u0e49\u0e19\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19 \u0e08\u0e30\u0e21\u0e35 2 \u0e01\u0e23\u0e13\u0e35\u0e04\u0e37\u0e2d companion object function \u0e41\u0e25\u0e30 function \u0e17\u0e35\u0e48\u0e08\u0e30\u0e15\u0e49\u0e2d\u0e07\u0e1b\u0e23\u0e30\u0e01\u0e32\u0e28 object \u0e02\u0e2d\u0e07\u0e04\u0e25\u0e32\u0e2a\u0e15\u0e32\u0e21\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#000000;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>class ImageUtil(context: Context)<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki light-plus\" style=\"background-color: #FFFFFF\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #0000FF\">class<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #267F99\">ImageUtil<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #267F99\">context<\/span><span style=\"color: #000000\">: <\/span><span style=\"color: #267F99\">Context<\/span><span style=\"color: #000000\">)<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"variables-companion-object\"><strong>Variables Companion Object<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table style=\"border-width:1px\"><thead><tr><th>Name<\/th><th>Description<\/th><th>Type<\/th><th>Default<\/th><th>Variable Type<\/th><\/tr><\/thead><tbody><tr><td>EXT_JPEG<\/td><td>\u0e19\u0e32\u0e21\u0e2a\u0e01\u0e38\u0e25\u0e44\u0e1f\u0e25\u0e4c .jpg<\/td><td>String<\/td><td>&#8220;.jpg&#8221;<\/td><td>const val<\/td><\/tr><tr><td>EXT_PNG<\/td><td>\u0e19\u0e32\u0e21\u0e2a\u0e01\u0e38\u0e25\u0e44\u0e1f\u0e25\u0e4c .png<\/td><td>String<\/td><td>&#8220;.png&#8221;<\/td><td>const val<\/td><\/tr><tr><td>REQUEST_CODE_PHOTOCAM<\/td><td>Request Code 10002 \u0e44\u0e27\u0e49\u0e43\u0e0a\u0e49\u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a\u0e40\u0e0a\u0e47\u0e04\u0e43\u0e19 onActivityResult<\/td><td>Int<\/td><td>10002<\/td><td>const val<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"method-companion-object-overview\"><strong>Method Companion Object Overview<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table style=\"border-width:1px\"><thead><tr><th>Name<\/th><th>Description<\/th><th>Return<\/th><\/tr><\/thead><tbody><tr><td>encodeBitmapTobase64()<\/td><td>\u0e40\u0e02\u0e49\u0e32\u0e23\u0e2b\u0e31\u0e2a Bitmap \u0e43\u0e2b\u0e49\u0e40\u0e1b\u0e47\u0e19 Base64<\/td><td>String?<\/td><\/tr><tr><td>decodeToBase64()<\/td><td>\u0e16\u0e2d\u0e14\u0e23\u0e2b\u0e31\u0e2a String \u0e40\u0e1b\u0e47\u0e19 Bitmap<\/td><td>Bitmap?<\/td><\/tr><tr><td>convertUriToBitmap()<\/td><td>\u0e41\u0e1b\u0e25\u0e07 Uri \u0e40\u0e1b\u0e47\u0e19 Bitmap<\/td><td>Bitmap<\/td><\/tr><tr><td>convertURLtoBitmap()<\/td><td>\u0e41\u0e1b\u0e25\u0e07 URL \u0e40\u0e1b\u0e47\u0e19 Bitmap<\/td><td>Bitmap<\/td><\/tr><tr><td>getResizedBitmap()<\/td><td>\u0e41\u0e1b\u0e25\u0e07\u0e02\u0e19\u0e32\u0e14 Bitmap<\/td><td>Bitmap<\/td><\/tr><tr><td>getAngleImage()<\/td><td>\u0e04\u0e48\u0e32\u0e21\u0e38\u0e21\u0e02\u0e2d\u0e07\u0e23\u0e39\u0e1b<\/td><td>Int<\/td><\/tr><tr><td>rotateImage()<\/td><td>\u0e2b\u0e21\u0e38\u0e19 Bitmap<\/td><td>Bitmap<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"method-companion-object-details\"><strong>Method Companion Object Details<\/strong><\/h2>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#000000;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>fun encodeBitmapTobase64(image: Bitmap? , ext : String) : String?<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki light-plus\" style=\"background-color: #FFFFFF\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #001080\">fun<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #795E26\">encodeBitmapTobase64<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #001080\">image<\/span><span style=\"color: #000000\">: <\/span><span style=\"color: #001080\">Bitmap<\/span><span style=\"color: #000000\">? , <\/span><span style=\"color: #001080\">ext<\/span><span style=\"color: #000000\"> : <\/span><span style=\"color: #001080\">String<\/span><span style=\"color: #000000\">) : <\/span><span style=\"color: #001080\">String<\/span><span style=\"color: #000000\">?<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>\u0e40\u0e02\u0e49\u0e32\u0e23\u0e2b\u0e31\u0e2a Bitmap \u0e43\u0e2b\u0e49\u0e40\u0e1b\u0e47\u0e19 Base64<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"parameters\"><strong>Parameters<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table style=\"border-width:1px\"><thead><tr><th>Name<\/th><th>Description<\/th><th>Type<\/th><\/tr><\/thead><tbody><tr><td>image<\/td><td>Bitmap \u0e02\u0e2d\u0e07\u0e23\u0e39\u0e1b\u0e17\u0e35\u0e48\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23<\/td><td>Bitmap?<\/td><\/tr><tr><td>ext<\/td><td>\u0e19\u0e32\u0e21\u0e2a\u0e01\u0e38\u0e25\u0e02\u0e2d\u0e07\u0e44\u0e1f\u0e25\u0e4c\u0e23\u0e39\u0e1b \u0e04\u0e37\u0e2d EXT_JPEG \u0e2b\u0e23\u0e37\u0e2d EXT_JPEG<\/td><td>String<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"returns\"><strong>Returns<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table style=\"border-width:1px\"><thead><tr><th>Type<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td>String?<\/td><td>Return String \u0e17\u0e35\u0e48\u0e40\u0e02\u0e49\u0e32\u0e23\u0e2b\u0e31\u0e2a Base64<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#000000;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>fun decodeToBase64(input: String?): Bitmap?<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki light-plus\" style=\"background-color: #FFFFFF\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #001080\">fun<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #795E26\">decodeToBase64<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #001080\">input<\/span><span style=\"color: #000000\">: <\/span><span style=\"color: #001080\">String<\/span><span style=\"color: #000000\">?): <\/span><span style=\"color: #001080\">Bitmap<\/span><span style=\"color: #000000\">?<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>\u0e16\u0e2d\u0e14\u0e23\u0e2b\u0e31\u0e2a String \u0e40\u0e1b\u0e47\u0e19 Bitmap<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"parameters-1\"><strong>Parameters<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table style=\"border-width:1px\"><thead><tr><th>Name<\/th><th>Description<\/th><th>Type<\/th><\/tr><\/thead><tbody><tr><td>input<\/td><td>String \u0e17\u0e35\u0e48\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e16\u0e2d\u0e14\u0e23\u0e2b\u0e31\u0e2a<\/td><td>String?<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"returns-1\"><strong>Returns<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table style=\"border-width:1px\"><thead><tr><th>Type<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td>Bitmap?<\/td><td>Return Bitmap \u0e17\u0e35\u0e48\u0e16\u0e2d\u0e14\u0e08\u0e32\u0e01 String<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#000000;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>fun convertUriToBitmap(uri : Uri) : Bitmap<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki light-plus\" style=\"background-color: #FFFFFF\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #001080\">fun<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #795E26\">convertUriToBitmap<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #001080\">uri<\/span><span style=\"color: #000000\"> : <\/span><span style=\"color: #001080\">Uri<\/span><span style=\"color: #000000\">) : <\/span><span style=\"color: #001080\">Bitmap<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>\u0e41\u0e1b\u0e25\u0e07 Uri \u0e40\u0e1b\u0e47\u0e19 Bitmap<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"parameters-2\"><strong>Parameters<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table style=\"border-width:1px\"><thead><tr><th>Name<\/th><th>Description<\/th><th>Type<\/th><\/tr><\/thead><tbody><tr><td>uri<\/td><td>uri \u0e17\u0e35\u0e48\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e41\u0e1b\u0e25\u0e07<\/td><td>Uri<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"returns-2\"><strong>Returns<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table style=\"border-width:1px\"><thead><tr><th>Type<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td>Bitmap<\/td><td>Return Bitmap \u0e17\u0e35\u0e48\u0e41\u0e1b\u0e25\u0e07\u0e08\u0e32\u0e01 Uri<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#000000;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>fun convertURLtoBitmap(url: URL) : Bitmap<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki light-plus\" style=\"background-color: #FFFFFF\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #001080\">fun<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #795E26\">convertURLtoBitmap<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #001080\">url<\/span><span style=\"color: #000000\">: <\/span><span style=\"color: #0070C1\">URL<\/span><span style=\"color: #000000\">) : <\/span><span style=\"color: #001080\">Bitmap<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>\u0e41\u0e1b\u0e25\u0e07 URL \u0e40\u0e1b\u0e47\u0e19 Bitmap<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"parameters-3\"><strong>Parameters<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table style=\"border-width:1px\"><thead><tr><th>Name<\/th><th>Description<\/th><th>Type<\/th><\/tr><\/thead><tbody><tr><td>url<\/td><td>url \u0e17\u0e35\u0e48\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e41\u0e1b\u0e25\u0e07<\/td><td>URL<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"returns-3\"><strong>Returns<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table style=\"border-width:1px\"><thead><tr><th>Type<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td>Bitmap<\/td><td>Return Bitmap \u0e17\u0e35\u0e48\u0e41\u0e1b\u0e25\u0e07\u0e08\u0e32\u0e01 URL<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#000000;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>fun getResizedBitmap(path: String , image: Bitmap , maxWidth : Int , maxHeight : Int) : Bitmap<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki light-plus\" style=\"background-color: #FFFFFF\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #001080\">fun<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #795E26\">getResizedBitmap<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #001080\">path<\/span><span style=\"color: #000000\">: <\/span><span style=\"color: #001080\">String<\/span><span style=\"color: #000000\"> , <\/span><span style=\"color: #001080\">image<\/span><span style=\"color: #000000\">: <\/span><span style=\"color: #001080\">Bitmap<\/span><span style=\"color: #000000\"> , <\/span><span style=\"color: #001080\">maxWidth<\/span><span style=\"color: #000000\"> : <\/span><span style=\"color: #001080\">Int<\/span><span style=\"color: #000000\"> , <\/span><span style=\"color: #001080\">maxHeight<\/span><span style=\"color: #000000\"> : <\/span><span style=\"color: #001080\">Int<\/span><span style=\"color: #000000\">) : <\/span><span style=\"color: #001080\">Bitmap<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>\u0e41\u0e1b\u0e25\u0e07\u0e02\u0e19\u0e32\u0e14 Bitmap<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"parameters-4\"><strong>Parameters<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table style=\"border-width:1px\"><thead><tr><th>Name<\/th><th>Description<\/th><th>Type<\/th><\/tr><\/thead><tbody><tr><td>path<\/td><td>path \u0e02\u0e2d\u0e07\u0e23\u0e39\u0e1b\u0e17\u0e35\u0e48\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23<\/td><td>String<\/td><\/tr><tr><td>image<\/td><td>Bitmap \u0e17\u0e35\u0e48\u0e40\u0e1b\u0e47\u0e19\u0e23\u0e39\u0e1b\u0e17\u0e35\u0e48\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23<\/td><td>Bitmap<\/td><\/tr><tr><td>maxWidth<\/td><td>\u0e04\u0e27\u0e32\u0e21\u0e01\u0e27\u0e49\u0e32\u0e07\u0e2a\u0e39\u0e07\u0e2a\u0e38\u0e14\u0e17\u0e35\u0e48\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23<\/td><td>Int<\/td><\/tr><tr><td>maxHeight<\/td><td>\u0e04\u0e27\u0e32\u0e21\u0e2a\u0e39\u0e07\u0e2a\u0e39\u0e07\u0e2a\u0e38\u0e14\u0e17\u0e35\u0e48\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23<\/td><td>Int<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"returns-4\"><strong>Returns<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table style=\"border-width:1px\"><thead><tr><th>Type<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td>Bitmap<\/td><td>Return Bitmap \u0e17\u0e35\u0e48\u0e40\u0e1b\u0e25\u0e35\u0e48\u0e22\u0e19\u0e41\u0e1b\u0e25\u0e07\u0e02\u0e19\u0e32\u0e14\u0e41\u0e25\u0e49\u0e27<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#000000;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>fun getAngleImage(photoPath: String): Int<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki light-plus\" style=\"background-color: #FFFFFF\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #001080\">fun<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #795E26\">getAngleImage<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #001080\">photoPath<\/span><span style=\"color: #000000\">: <\/span><span style=\"color: #001080\">String<\/span><span style=\"color: #000000\">): <\/span><span style=\"color: #001080\">Int<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>\u0e04\u0e48\u0e32\u0e21\u0e38\u0e21\u0e02\u0e2d\u0e07\u0e23\u0e39\u0e1b<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"parameters-5\"><strong>Parameters<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table style=\"border-width:1px\"><thead><tr><th>Name<\/th><th>Description<\/th><th>Type<\/th><\/tr><\/thead><tbody><tr><td>photoPath<\/td><td>path \u0e44\u0e1f\u0e25\u0e4c\u0e23\u0e39\u0e1b<\/td><td>String<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"returns-5\"><strong>Returns<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table style=\"border-width:1px\"><thead><tr><th>Type<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td>Int<\/td><td>Return Int \u0e17\u0e35\u0e48\u0e40\u0e1b\u0e47\u0e19\u0e04\u0e48\u0e32\u0e21\u0e38\u0e21\u0e02\u0e2d\u0e07\u0e23\u0e39\u0e1b<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#000000;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>fun rotateImage(bitmap : Bitmap, angle: Float): Bitmap<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki light-plus\" style=\"background-color: #FFFFFF\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #001080\">fun<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #795E26\">rotateImage<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #001080\">bitmap<\/span><span style=\"color: #000000\"> : <\/span><span style=\"color: #001080\">Bitmap<\/span><span style=\"color: #000000\">, <\/span><span style=\"color: #001080\">angle<\/span><span style=\"color: #000000\">: <\/span><span style=\"color: #001080\">Float<\/span><span style=\"color: #000000\">): <\/span><span style=\"color: #001080\">Bitmap<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>\u0e2b\u0e21\u0e38\u0e19 Bitmap<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"parameters-6\"><strong>Parameters<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table style=\"border-width:1px\"><thead><tr><th>Name<\/th><th>Description<\/th><th>Type<\/th><\/tr><\/thead><tbody><tr><td>bitmap<\/td><td>Bitmap \u0e17\u0e35\u0e48\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e2b\u0e21\u0e38\u0e19<\/td><td>Bitmap<\/td><\/tr><tr><td>angle<\/td><td>\u0e21\u0e38\u0e21\u0e17\u0e35\u0e48\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e2b\u0e21\u0e38\u0e19<\/td><td>Float<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"returns-6\"><strong>Returns<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table style=\"border-width:1px\"><thead><tr><th>Type<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td>Bitmap<\/td><td>Return Bitmap \u0e17\u0e35\u0e48\u0e2b\u0e21\u0e38\u0e19\u0e41\u0e25\u0e49\u0e27<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"method-class-overview\"><strong>Method class Overview<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table style=\"border-width:1px\"><thead><tr><th>Name<\/th><th>Description<\/th><th>Return<\/th><\/tr><\/thead><tbody><tr><td>addBitmapToCacheDir()<\/td><td>\u0e1a\u0e31\u0e19\u0e17\u0e36\u0e01 Bitmap \u0e44\u0e1b\u0e17\u0e35\u0e48 cache<\/td><td>String<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"method-details\"><strong>Method Details<\/strong><\/h2>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#000000;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>fun addBitmapToCacheDir(bitmap: Bitmap , imageName: String = DateUtil.getTimestamp().toString(), ext: String = EXT_JPEG): String<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki light-plus\" style=\"background-color: #FFFFFF\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #001080\">fun<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #795E26\">addBitmapToCacheDir<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #001080\">bitmap<\/span><span style=\"color: #000000\">: <\/span><span style=\"color: #001080\">Bitmap<\/span><span style=\"color: #000000\"> , <\/span><span style=\"color: #001080\">imageName<\/span><span style=\"color: #000000\">: <\/span><span style=\"color: #001080\">String<\/span><span style=\"color: #000000\"> = <\/span><span style=\"color: #001080\">DateUtil<\/span><span style=\"color: #000000\">.<\/span><span style=\"color: #795E26\">getTimestamp<\/span><span style=\"color: #000000\">().<\/span><span style=\"color: #795E26\">toString<\/span><span style=\"color: #000000\">(), <\/span><span style=\"color: #001080\">ext<\/span><span style=\"color: #000000\">: <\/span><span style=\"color: #001080\">String<\/span><span style=\"color: #000000\"> = <\/span><span style=\"color: #0070C1\">EXT_JPEG<\/span><span style=\"color: #000000\">): <\/span><span style=\"color: #001080\">String<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>\u0e1a\u0e31\u0e19\u0e17\u0e36\u0e01 Bitmap \u0e44\u0e1b\u0e17\u0e35\u0e48 cache<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"parameters-7\"><strong>Parameters<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table style=\"border-width:1px\"><thead><tr><th>Name<\/th><th>Description<\/th><th>Type<\/th><th>Default<\/th><\/tr><\/thead><tbody><tr><td>bitmap<\/td><td>bitmap \u0e02\u0e2d\u0e07\u0e23\u0e39\u0e1b<\/td><td>Bitmap<\/td><td><\/td><\/tr><tr><td>imageName<\/td><td>\u0e0a\u0e37\u0e48\u0e2d\u0e44\u0e1f\u0e25\u0e4c\u0e23\u0e39\u0e1b<\/td><td>String<\/td><td>DateUtil.getTimestamp().toString()<\/td><\/tr><tr><td>ext<\/td><td>\u0e19\u0e32\u0e21\u0e2a\u0e01\u0e38\u0e25\u0e44\u0e1f\u0e25\u0e4c<\/td><td>String<\/td><td>EXT_JPEG<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"returns-7\"><strong>Returns<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table style=\"border-width:1px\"><thead><tr><th>Type<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td>String<\/td><td>Return String \u0e40\u0e1b\u0e47\u0e19 path \u0e17\u0e35\u0e48\u0e1a\u0e31\u0e19\u0e17\u0e36\u0e01<\/td><\/tr><\/tbody><\/table><\/figure>\n","protected":false},"featured_media":0,"parent":2531,"menu_order":8,"comment_status":"closed","ping_status":"closed","template":"","meta":{"nav_title":"","positive":"","negative":"","footnotes":""},"docs_category":[],"class_list":["post-2636","docs","type-docs","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/docs\/2636","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/types\/docs"}],"replies":[{"embeddable":true,"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/comments?post=2636"}],"version-history":[{"count":9,"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/docs\/2636\/revisions"}],"predecessor-version":[{"id":2669,"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/docs\/2636\/revisions\/2669"}],"up":[{"embeddable":true,"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/docs\/2531"}],"wp:attachment":[{"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/media?parent=2636"}],"wp:term":[{"taxonomy":"docs_category","embeddable":true,"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/docs_category?post=2636"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}