Framebuffer -> Image

Markus Forrer 21 Reputation points
2021-04-16T05:23:57.667+00:00

I am implementing a Phyton tool new in C#. The Phyton tool converts a framebuffer of a monochrome LCD display 240x128 into an image as follows:

image = QImage(buffer, LcdWidth, LcdHeight, QImage.Format_Grayscale8)

In my C# tool I tried it like this:

WriteableBitmap writeableBitmap = new WriteableBitmap(pixelWidth, pixelHeight, 72, 72, PixelFormats.Gray8, null);
writeableBitmap.WritePixels(new Int32Rect(0, 0, (int)writeableBitmap.Width, (int)writeableBitmap.Height), buffer, 1, 1);

Unfortunately, I don't get anywhere with this approach.

Thank you for any hints.

Developer technologies | Windows Presentation Foundation
Developer technologies | C#
Developer technologies | C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
{count} votes

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.