Update to newer version of CSJ2K from github.com/cureos/csj2k with modification
This commit is contained in:
53
CSJ2K/Util/WriteableBitmapImageCreator.cs
Normal file
53
CSJ2K/Util/WriteableBitmapImageCreator.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
// Copyright (c) 2007-2016 CSJ2K contributors.
|
||||
// Licensed under the BSD 3-Clause License.
|
||||
|
||||
namespace CSJ2K.Util
|
||||
{
|
||||
using System;
|
||||
|
||||
using CSJ2K.j2k.image;
|
||||
|
||||
public class WriteableBitmapImageCreator : IImageCreator
|
||||
{
|
||||
#region FIELDS
|
||||
|
||||
private static readonly IImageCreator Instance = new WriteableBitmapImageCreator();
|
||||
|
||||
#endregion
|
||||
|
||||
#region PROPERTIES
|
||||
|
||||
/// <summary>
|
||||
/// Gets whether or not this type is classified as a default manager.
|
||||
/// </summary>
|
||||
public bool IsDefault
|
||||
{
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region METHODS
|
||||
|
||||
public static void Register()
|
||||
{
|
||||
ImageFactory.Register(Instance);
|
||||
}
|
||||
|
||||
public IImage Create(int width, int height, byte[] bytes)
|
||||
{
|
||||
return new WriteableBitmapImage(width, height, bytes);
|
||||
}
|
||||
|
||||
public BlkImgDataSrc ToPortableImageSource(object imageObject)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
//return WriteableBitmapImageSource.Create(imageObject);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user