Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dotnet-ad/Assetxport
Resize UWP, Xamarin.Android and Xamarin.iOS assets automatically.
https://github.com/dotnet-ad/Assetxport
assets resize tool xamarin
Last synced: 30 days ago
JSON representation
Resize UWP, Xamarin.Android and Xamarin.iOS assets automatically.
- Host: GitHub
- URL: https://github.com/dotnet-ad/Assetxport
- Owner: dotnet-ad
- License: mit
- Created: 2017-07-27T19:45:28.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-07T18:51:18.000Z (about 2 years ago)
- Last Synced: 2024-11-08T22:16:44.518Z (about 1 month ago)
- Topics: assets, resize, tool, xamarin
- Language: C#
- Size: 119 KB
- Stars: 16
- Watchers: 3
- Forks: 2
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-xamarin-forms - Assetxport ★15
README
![Logo](Documentation/Logo.png)
Resize UWP, Xamarin.Android and Xamarin.iOS assets automatically at build time.
## Install
Available on NuGet
[![NuGet](https://img.shields.io/nuget/v/Assetxport.svg?label=NuGet)](https://www.nuget.org/packages/Assetxport/)
## Usage
The easiest way is to use **Assetxport** from its build task. Simply add a [NuGet](https://www.nuget.org/packages/Assetxport/) package reference to your **Xamarin.iOS**, **Xamarin.Android** or **Universal Windows Platform** project and add a `Config.assets.json` configuration file at the root of your project.
`Config.assets.json`
```json
{
"Platform": "",
"Input": [ "" ],
"Output": ""
}
``````json
{
"Platform": "iOS",
"Input": [ "../Assetxport.Sample.Cli/Images/" ],
"Output": "Assets.xcassets"
}
```In your high definition asset source folder, all `.png`|`.jpg` images should have a suffix qualifier indicating their original density. Here is the list of available qualifiers :
* `.` : **1.00**
* `@x.` : **value**
* `@ldpi.` : **0.75**
* `@mdpi.` : **1.00**
* `@hdpi.` : **1.50**
* `@xhdpi.` : **2.00**
* `@xxhdpi.` : **3.00**
* `@xxxhdpi.` : **4.00**Then simply build the project to generate your various assets (*with densities lower or equal to the original density*) to the output folder!
## Platforms
### iOS
Assets are generated as asset catalog entries (`.imageset`).
### Android
Assets are generated inside qualified drawable sub folders (`drawable-hdpi`, `drawable-xhdpi`, ...).
### UWP
Assets are generated with a qualified suffix indicating the scale (`scale-100`, `scale-240`, ...).
## Cli
The standalone `.exe` CLI used by the build task is available from the `/tools` folder of the NuGet package.
## Under the hood
The tool uses [SkiaSharp](https://github.com/mono/SkiaSharp) to resize all images.
## Contributions
Contributions are welcome! If you find a bug please report it and if you want a feature please report it.
If you want to contribute code please file an issue and create a branch off of the current dev branch and file a pull request.
## License
MIT © [Aloïs Deniel](http://aloisdeniel.github.io)