Skip to content

Sample code for OutputDevices.Display fails with System.TypeLoadException for Method 'EncodeAsync' #8

@cdowideit

Description

@cdowideit

With this sample code (from https://parzivail.github.io/ReMarkable.NET/articles/intro.html):

// Create an image
var img = new Image<Rgb24>(300, 300);

// Do some image processing
img.Mutate(ctx => ctx.DrawLines(Color.Black, 3, new PointF(50, 50), new PointF(250, 250)));

// Draw the image to the screen
OutputDevices.Display.Draw(img, img.Bounds(), Point.Empty);

The following exception occurs:

Unhandled exception. System.TypeLoadException: Method 'EncodeAsync' in type 'ReMarkable.NET.Graphics.Rgb565FramebufferEncoder' from assembly 'ReMarkable.NET, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.
   at ReMarkable.NET.Unix.Driver.Display.Framebuffer.HardwareFramebuffer.Write[TPixel](Image`1 image, Rectangle srcArea, Point destPoint)
   at ReMarkable.NET.Unix.Driver.Display.HardwareDisplayDriver.Draw(Image`1 image, Rectangle srcArea, Point destPoint, Rectangle refreshArea, WaveformMode mode)

Looking at the source, the reason is obvious.

public Task EncodeAsync<TPixel>(Image<TPixel> image, Stream stream) where TPixel : unmanaged, IPixel<TPixel>
{
    throw new NotImplementedException();
}

How can it me made to work, e.g. is it possible to force it to use "Encode" instead?

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions