{"id":13902476,"url":"https://github.com/zetbaitsu/Cekrek","last_synced_at":"2025-07-18T00:31:36.058Z","repository":{"id":46786002,"uuid":"284382545","full_name":"zetbaitsu/Cekrek","owner":"zetbaitsu","description":"An android library that allows you to export any view to bitmap or image file in a convenient way.","archived":false,"fork":false,"pushed_at":"2020-08-04T10:23:09.000Z","size":162,"stargazers_count":101,"open_issues_count":0,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-07T11:21:04.358Z","etag":null,"topics":["android","android-library","export-image","export-view","save-view","view-to-bitmap","view-to-image","view-to-pdf"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zetbaitsu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-08-02T03:25:51.000Z","updated_at":"2024-11-05T18:36:33.000Z","dependencies_parsed_at":"2022-08-12T13:01:18.550Z","dependency_job_id":null,"html_url":"https://github.com/zetbaitsu/Cekrek","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zetbaitsu%2FCekrek","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zetbaitsu%2FCekrek/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zetbaitsu%2FCekrek/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zetbaitsu%2FCekrek/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zetbaitsu","download_url":"https://codeload.github.com/zetbaitsu/Cekrek/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226310601,"owners_count":17604612,"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-library","export-image","export-view","save-view","view-to-bitmap","view-to-image","view-to-pdf"],"created_at":"2024-08-06T22:01:10.039Z","updated_at":"2024-11-25T10:32:10.440Z","avatar_url":"https://github.com/zetbaitsu.png","language":"Kotlin","funding_links":[],"categories":["Kotlin"],"sub_categories":[],"readme":"Cekrek\n======\n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Cekrek-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/8141)\n[![Build Status](https://travis-ci.org/zetbaitsu/Cekrek.svg?branch=master)](https://travis-ci.org/zetbaitsu/Cekrek)\n[![codecov](https://codecov.io/gh/zetbaitsu/Cekrek/branch/master/graph/badge.svg)](https://codecov.io/gh/zetbaitsu/Cekrek)\n[![Code Climate](https://codeclimate.com/github/zetbaitsu/Cekrek/badges/gpa.svg)](https://codeclimate.com/github/zetbaitsu/Cekrek)\n\nCekrek is an android library that allows you to export any view to bitmap or image file in a convenient way.\n\n* Export or generate `Bitmap` from a `View` without needed to displaying it.\n* Export or generate `Image File` from a `View` without needed to displaying it.\n* Configurable bitmap and image file generator.\n* With `View` extension function for `Kotlin` user.\n* Friendly method for `Java` user too.\n\n\n# Gradle\n```groovy\ndependencies {\n    implementation 'id.zelory:cekrek:1.0.0'\n}\n```\n# Export a view to bitmap\n#### Export to bitmap\n```kotlin\nval bitmap = Cekrek.toBitmap(view)\n```\n#### Export to bitmap with configuration\n```kotlin\n// export view to 1280 x 1280 canvas with red background color.\nval bitmap = Cekrek.toBitmap(view) {\n    canvasConfig.width = CanvasSize.Specific(1280) // set canvas size to 1280 px\n    canvasConfig.height = CanvasSize.Specific(1280) // default is CanvasSize.WrapContent\n    canvasConfig.color = Color.RED // default is Color.WHITE\n}\n```\n#### Export to bitmap with extension function\n```kotlin\nval bitmap = view.cekrekToBitmap()\n```\n#### Export to bitmap with extension function + configuration\n```kotlin\n// export view to 1280 x 1280 canvas with red background color.\nval bitmap = view.cekrekToBitmap {\n    canvasConfig.width = CanvasSize.Specific(1280) // set canvas size to 1280 px\n    canvasConfig.height = CanvasSize.Specific(1280) // default is CanvasSize.WrapContent\n    canvasConfig.color = Color.RED // default is Color.WHITE\n}\n```\n#### Export to bitmap with config variable\n```kotlin\nval config = CekrekConfig().apply {\n    canvasConfig.width = CanvasSize.Specific(1280)\n}\nval bitmap = Cekrek.toBitmap(view, config)\n// or\nval bitmap = view.cekrekToBitmap(config)\n```\n# Export a view to image file\n#### Export to image file\n```kotlin\nval imageFile = Cekrek.toImageFile(view, destination)\n```\n#### Export to image file with configuration\n```kotlin\n// export view to 1280 x 1280 canvas with red background color and save it as PNG file.\nval imageFile = Cekrek.toImageFile(view, destination) {\n    cekrekConfig.canvasConfig.width = CanvasSize.Specific(1280) // set canvas size to 1280 px\n    cekrekConfig.canvasConfig.height = CanvasSize.Specific(1280) // default is CanvasSize.WrapContent\n    cekrekConfig.canvasConfig.color = Color.RED // default is Color.WHITE\n    format = Bitmap.CompressFormat.PNG\n}\n```\n#### Export to image file with extension function\n```kotlin\nval imageFile = view.cekrekToImageFile(destination)\n```\n#### Export to image file with extension function + configuration\n```kotlin\n// export view to 1280 x 1280 canvas with red background color and save it as PNG file.\nval imageFile = view.cekrekToImageFile(destination) {\n    cekrekConfig.canvasConfig.width = CanvasSize.Specific(1280) // set canvas size to 1280 px\n    cekrekConfig.canvasConfig.height = CanvasSize.Specific(1280) // default is CanvasSize.WrapContent\n    cekrekConfig.canvasConfig.color = Color.RED // default is Color.WHITE\n    format = Bitmap.CompressFormat.PNG\n}\n```\n#### Export to image file with config variable\n```kotlin\nval config = CekrekImageFileConfig(destination).apply {\n    cekrekConfig.canvasConfig.width = CanvasSize.Specific(1280)\n    format = Bitmap.CompressFormat.PNG\n}\nval imageFile = Cekrek.toImageFile(view, config)\n// or\nval imageFile = view.cekrekToImageFile(config)\n```\nLicense\n-------\n    Copyright (c) 2020 Zetra.\n    \n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzetbaitsu%2FCekrek","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzetbaitsu%2FCekrek","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzetbaitsu%2FCekrek/lists"}