Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
PixelInformationPng.cs
1using System;
2using SkiaSharp;
3
5{
10 {
17 public PixelInformationPng(byte[] Binary, int Width, int Height)
18 : base(Binary, Width, Height)
19 {
20 }
21
26 public override SKImage CreateBitmap()
27 {
28 using (SKBitmap Bitmap = SKBitmap.Decode(this.Binary))
29 {
30 return SKImage.FromBitmap(Bitmap);
31 }
32 }
33
38 public override byte[] EncodeAsPng()
39 {
40 return this.Binary;
41 }
42
47 public override PixelInformationRaw GetRaw()
48 {
49 using (SKBitmap Bitmap = SKBitmap.Decode(this.Binary))
50 {
51 return new PixelInformationRaw(Bitmap.ColorType, Bitmap.Bytes, Bitmap.Width, Bitmap.Height,
52 Bitmap.Width * Bitmap.BytesPerPixel);
53 }
54 }
55 }
56}
Contains pixel information
byte[] Binary
Binary representation of pixels
Contains pixel information in PNG format
override byte[] EncodeAsPng()
Encodes the pixels into a binary PNG image.
override PixelInformationRaw GetRaw()
Gets raw pixel data.
override SKImage CreateBitmap()
Creates an SKImage image. It must be disposed by the caller.
PixelInformationPng(byte[] Binary, int Width, int Height)
Contains pixel information in PNG format
Contains pixel information in a raw unencoded format.