Pixelbin 1.0.1
dotnet add package Pixelbin --version 1.0.1
NuGet\Install-Package Pixelbin -Version 1.0.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Pixelbin" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Pixelbin --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Pixelbin, 1.0.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Pixelbin as a Cake Addin
#addin nuget:?package=Pixelbin&version=1.0.1
// Install Pixelbin as a Cake Tool
#tool nuget:?package=Pixelbin&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Pixelbin Backend SDK for C#
Pixelbin Backend SDK for C# helps you integrate the core Pixelbin features with your application.
Getting Started
Getting started with Pixelbin Backend SDK for C#
Installation
dotnet add package pixelbin
Usage
Quick Example
using System;
using System.Collections.Generic;
using System.IO;
using Pixelbin.Platform;
namespace ExampleNamespace
{
class ExampleClass
{
async void Main(string[] args)
{
// create client with your API_TOKEN
PixelbinConfig config = new PixelbinConfig(
new Dictionary<string, string>() {
{ "domain", "https://api.pixelbin.io" },
{ "apiSecret", "API_TOKEN" }
});
// Create a pixelbin instance
PixelbinClient pixelbin = new PixelbinClient(config);
// Sync method call
try
{
var result = pixelbin.assets.listFiles();
Console.WriteLine(result);
}
catch (Exception e)
{
Console.WriteLine(e);
}
// Async method call
try
{
var result = await pixelbin.assets.listFilesAsync();
Console.WriteLine(result);
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
Utilities
Pixelbin provides url utilities to construct and deconstruct Pixelbin urls.
url_to_obj
Deconstruct a pixelbin url
parameter | description | example |
---|---|---|
url (string) | A valid pixelbin url | https://cdn.pixelbin.io/v2/your-cloud-name/z-slug/t.resize(h:100,w:200)~t.flip()/path/to/image.jpeg |
Returns:
property | description | example |
---|---|---|
cloudName (string) | The cloudname extracted from the url | your-cloud-name |
zone (string) | 6 character zone slug | z-slug |
version (string) | cdn api version | v2 |
options (Dictionary<string, object>) | optional query parameters | |
transformations (List<Dictionary<string, object>>) | Extracted transformations from the url | |
filePath (string) | Path to the file on Pixelbin storage | /path/to/image.jpeg |
baseUrl (string) | Base url | https://cdn.pixelbin.io/ |
Example:
using System;
using System.Collections.Generic;
using System.IO;
using Pixelbin.Utils;
namespace ExampleNamespace
{
class ExampleClass
{
void Main(string[] args)
{
string pixelbinUrl = "https://cdn.pixelbin.io/v2/your-cloud-name/z-slug/t.resize(h:100,w:200)~t.flip()/path/to/image.jpeg?dpr=2.0&f_auto=True";
UrlObj obj = Url.UrlToObj(pixelbinUrl);
// returned obj schema when serialized to json
// {
// "cloudName": "your-cloud-name",
// "zone": "z-slug",
// "version": "v2",
// "options": {
// "dpr": 2.0,
// "f_auto": True,
// },
// "transformations": [
// {
// "plugin": "t",
// "name": "resize",
// "values": [
// {
// "key": "h",
// "value": "100"
// },
// {
// "key": "w",
// "value": "200"
// }
// ]
// },
// {
// "plugin": "t",
// "name": "flip",
// }
// ],
// "filePath": "path/to/image.jpeg",
// "baseUrl": "https://cdn.pixelbin.io"
// }
}
}
}
obj_to_url
Converts the extracted url obj to a Pixelbin url.
property | description | example |
---|---|---|
cloudName (string) | The cloudname extracted from the url | your-cloud-name |
zone (string) | 6 character zone slug | z-slug |
version (string) | cdn api version | v2 |
options (Dictionary<string, object>) | optional query parameters | |
transformations (List<Dictionary<string, object>>) | Extracted transformations from the url | |
filePath (string) | Path to the file on Pixelbin storage | /path/to/image.jpeg |
baseUrl (string) | Base url | https://cdn.pixelbin.io/ |
using System;
using System.Collections.Generic;
using System.IO;
using Pixelbin.Utils;
namespace ExampleNamespace
{
class ExampleClass
{
void Main(string[] args)
{
UrlObj obj = new UrlObj (
version: "v2",
cloudName: "your-cloud-name",
filePath: "path/to/image.jpeg",
options: new UrlObjOptions() {
dpr: 2.0,
f_auto: true
},
zone: "z-slug",
baseUrl: "https://cdn.pixelbin.io",
transformations: new List<UrlTransformation>() {
new UrlTransformation(
plugin: "t",
name: "resize",
values: new List<Dictionary<string, string>>() {
new Dictionary<string, string>() { { "key", "h" }, { "value", "200" } },
new Dictionary<string, string>() { { "key", "w" }, { "value", "200" } }
}
),
new UrlTransformation(
plugin: "t",
name: "flip"
)
}
);
string url = obj_to_url(obj)
// returned url string
// https://cdn.pixelbin.io/v2/your-cloud-name/z-slug/t.resize(h:100,w:200)~t.flip()/path/to/image.jpeg?dpr=2.0&f_auto=True
}
}
}
Documentation
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.1
- Newtonsoft.Json (>= 13.0.3)
- TimeZoneConverter (>= 6.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.1 | 55,693 | 5/9/2023 |