{"id":13606619,"url":"https://github.com/PatilShreyas/Capturable","last_synced_at":"2025-04-12T08:31:41.677Z","repository":{"id":36979270,"uuid":"443739632","full_name":"PatilShreyas/Capturable","owner":"PatilShreyas","description":"🚀Jetpack Compose utility library for capturing Composable content and transforming it into Bitmap Image🖼️","archived":false,"fork":false,"pushed_at":"2025-03-13T03:39:35.000Z","size":2467,"stargazers_count":1130,"open_issues_count":11,"forks_count":45,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-06T11:03:57.247Z","etag":null,"topics":["android","android-app","bitmap","composable","hacktoberfest","image","jetpack-android","jetpack-compose","kotlin","photos","screenshot"],"latest_commit_sha":null,"homepage":"https://patilshreyas.github.io/Capturable/","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PatilShreyas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":"PatilShreyas","otechie":null,"custom":["https://www.paypal.me/PatilShreyas99/"]}},"created_at":"2022-01-02T10:40:40.000Z","updated_at":"2025-04-05T12:57:40.000Z","dependencies_parsed_at":"2024-01-16T23:30:37.217Z","dependency_job_id":"b9c479a7-6427-49e4-9748-ddd6377c34d9","html_url":"https://github.com/PatilShreyas/Capturable","commit_stats":{"total_commits":166,"total_committers":3,"mean_commits":"55.333333333333336","dds":0.4036144578313253,"last_synced_commit":"8509a5e6abe23e26c82051245e21715b4dbf657b"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PatilShreyas%2FCapturable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PatilShreyas%2FCapturable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PatilShreyas%2FCapturable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PatilShreyas%2FCapturable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PatilShreyas","download_url":"https://codeload.github.com/PatilShreyas/Capturable/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248539921,"owners_count":21121260,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","android-app","bitmap","composable","hacktoberfest","image","jetpack-android","jetpack-compose","kotlin","photos","screenshot"],"created_at":"2024-08-01T19:01:10.715Z","updated_at":"2025-04-12T08:31:36.658Z","avatar_url":"https://github.com/PatilShreyas.png","language":"Kotlin","funding_links":["https://issuehunt.io/r/PatilShreyas","https://www.paypal.me/PatilShreyas99/"],"categories":["Kotlin"],"sub_categories":[],"readme":"# Capturable\n\n![Capturable](art/header.png)\n\n🚀A Jetpack Compose utility library for converting Composable content into Bitmap image 🖼️.  \n_Made with ❤️ for Android Developers and Composers_ \n\n[![Build](https://github.com/PatilShreyas/Capturable/actions/workflows/build.yml/badge.svg)](https://github.com/PatilShreyas/Capturable/actions/workflows/build.yml)\n[![Maven Central](https://img.shields.io/maven-central/v/dev.shreyaspatil/capturable)](https://search.maven.org/artifact/dev.shreyaspatil/capturable)\n\n## 💡Introduction \n\nIn the previous View system, drawing Bitmap Image from `View` was very straightforward. But that's not the case with Jetpack Compose since it's different in many aspects from previous system. This library helps easy way to achieve the same results.\n\n## 🚀 Implementation\n\nYou can check [/app](/app) directory which includes example application for demonstration. \n\n### Gradle setup\n\nIn `build.gradle` of app module, include this dependency\n\n```gradle\ndependencies {\n    implementation \"dev.shreyaspatil:capturable:2.1.0\"\n}\n```\n\n_You can find latest version and changelogs in the [releases](https://github.com/PatilShreyas/Capturable/releases)_.\n\n### Usage\n\n#### 1. Setup the controller\n\nTo be able to capture Composable content, you need instance of [`CaptureController`](https://patilshreyas.github.io/Capturable/capturable/dev.shreyaspatil.capturable.controller/-capture-controller/index.html) by which you can decide when to capture the content. You can get the instance as follow.\n\n```kotlin\n@Composable\nfun TicketScreen() {\n    val captureController = rememberCaptureController()\n}\n```\n\n_[`rememberCaptureController()`](https://patilshreyas.github.io/Capturable/capturable/dev.shreyaspatil.capturable.controller/remember-capture-controller.html) is a Composable function._\n\n#### 2. Add the content\n\nThe component which needs to be captured, a `capturable()` Modifier should be applied on that @Composable component as follows.\n\n```kotlin\n@Composable\nfun TicketScreen() {\n    val captureController = rememberCaptureController()\n\n    // Composable content to be captured.\n    // Here, everything inside below Column will be get captured\n    Column(modifier = Modifier.capturable(captureController)) {\n        MovieTicketContent(...)\n    }\n}\n```\n\n#### 3. Capture the content\n\nTo capture the content, use [`CaptureController#captureAsync()`](https://patilshreyas.github.io/Capturable/capturable/dev.shreyaspatil.capturable.controller/-capture-controller/captureAsync.html) as follows. \n\n```kotlin\n// Example: Capture the content when button is clicked\nval scope = rememberCoroutineScope()\nButton(onClick = {\n    // Capture content\n    scope.launch {\n        val bitmapAsync = captureController.captureAsync()\n        try {\n            val bitmap = bitmapAsync.await()\n            // Do something with `bitmap`.\n        } catch (error: Throwable) {\n            // Error occurred, do something.\n        }\n    }\n}) { ... }\n```\n\nOn calling this method, request for capturing the content will be sent and `ImageBitmap` will be \nreturned asynchronously. _This method is safe to be called from Main thread._\n\n## 📄 API Documentation\n\n[**Visit the API documentation of this library**](https://patilshreyas.github.io/Capturable) to get more information in detail.\n\n---\n\n## 🙋‍♂️ Contribute \n\nRead [contribution guidelines](CONTRIBUTING.md) for more information regarding contribution.\n\n## 💬 Discuss? \n\nHave any questions, doubts or want to present your opinions, views? You're always welcome. You can [start discussions](https://github.com/PatilShreyas/Capturable/discussions).\n\n## 📝 License\n\n```\nMIT License\n\nCopyright (c) 2022 Shreyas Patil\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPatilShreyas%2FCapturable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FPatilShreyas%2FCapturable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPatilShreyas%2FCapturable/lists"}