VinnoImageDecoder.cs 796 B

123456789101112131415161718192021222324252627282930313233
  1. using SkiaSharp;
  2. using System.IO;
  3. namespace Vinno.vCloud.Common.Vid2.Codec
  4. {
  5. public class VinnoImageDecoder
  6. {
  7. /// <summary>
  8. /// Convert VinnoImage to Image
  9. /// </summary>
  10. /// <param name="image"></param>
  11. /// <returns></returns>
  12. private SKBitmap VinnoImageToImage(VinnoImage image)
  13. {
  14. using (var ms = new MemoryStream(image.ImageData))
  15. {
  16. return SKBitmap.Decode(ms);
  17. }
  18. }
  19. /// <summary>
  20. /// Decode the
  21. /// </summary>
  22. /// <param name="image"></param>
  23. /// <returns></returns>
  24. public SKBitmap Decode(VinnoImage image)
  25. {
  26. return VinnoImageToImage(image);
  27. }
  28. }
  29. }