Reply To: Brick-Simulator?

HomeForumsMonoBrick EV3 FirmwareBrick-Simulator?Reply To: Brick-Simulator?

Author Image
Martin Wagner

Hi Anders,
still fighting with Lcd: I cannot convert the byte-array to an image/bitmap.
Since Width=178 and Height=128, why is the dispbuffer-size = 2944 bytes, when 178*128/8 = 2848 bytes?

In all the information I found, the stride(bytes per line) is calculated
stride = width*(BitsPerPixel + 7)/8 with BitsPerPixel=1 (monochrom) I guess. Or is it a color bitmap?? (The code has color calculations.)

In lcd.cs it is:
public const int Width = 178;
public const int Height = 128;
public const int bytesPrLine = (Width+7)/8; // changed to public MW

Bug or feature that I miss? Shouldn’t it be
public const int bytesPrLine = Width*(1+7)/8; // This doesn’t work either

Do you have any suggestion how to convert dispBuffer in an standard Image or BitmapImage?

Any help would be great,

Posted in

Make a donation