Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SKBitmap issues on Ubuntu MATE for Raspberry Pi 2 #406

Closed
DanWBR opened this issue Dec 1, 2017 · 10 comments
Closed

SKBitmap issues on Ubuntu MATE for Raspberry Pi 2 #406

DanWBR opened this issue Dec 1, 2017 · 10 comments

Comments

@DanWBR
Copy link

DanWBR commented Dec 1, 2017

Hello,

I was able to successfully compile SkiaSharp for the RPi as detailed in #312. When running my app, the library gets loaded just fine, I see some native skia functions being called, etc etc etc until I try to create the bitmap to draw the canvas:

System.Exception: Unable to allocate pixels for the bitmap.

The exception is raised if I remove the using statement and put a try/catch block on here: https://github.com/DanWBR/dwsim5/blob/master/DWSIM.UI.Desktop.GTK/SkiaSharp/CanvasControl.cs#L149

The code in the above works on x86 Linux just fine.

I thought that it could be something related to the low video memory, then tried to fix the bitmap dimensions to 100x100px but it didn't help. Also tried all color types, none of them worked. Finally, I've tried to create the bitmap using the constructor which only takes the dimensions as input, but it also didn't work.

@DanWBR
Copy link
Author

DanWBR commented Dec 1, 2017

@mterwoord and @toburger, did you manage to instantiate a SKBitmap on the RPi?

@mterwoord
Copy link

No clue, I use avalonia, which worked great!

@toburger
Copy link

toburger commented Dec 2, 2017

Sorry, I use SkiaSharp exclusively to read image information and resize images (both via SKBitmap.Decode).
Do you have a minimal working example of your problem so I can test it out on my raspi?

@DanWBR
Copy link
Author

DanWBR commented Dec 2, 2017

@toburger just try to create a new SKBitmap using the constructor which takes only width and height as arguments. It didn't work for me.

@toburger
Copy link

toburger commented Dec 2, 2017

I get the same error:

Unhandled Exception: System.Exception: Unable to allocate pixels for the bitmap.

@DanWBR
Copy link
Author

DanWBR commented Dec 2, 2017

One thing I've noticed is that @mterwoord's script compiles the 1.57.1 version of SkiaSharp, while in my app I have the 1.59.1 managed library. I've tried to update the script to compile 1.59.1 but got a lot of errors. I'll then try to use the managed 1.57.1 library and let you know if it works.

@mterwoord
Copy link

My script was targetted for building a avalonia-compatible dll.

@toburger
Copy link

toburger commented Dec 2, 2017

I've completely forgot that I was using 1.57.1 on my project and mistakenly restored the latest SkiaSharp for this test. After using 1.57.1 the code works.

@DanWBR
Copy link
Author

DanWBR commented Dec 2, 2017

I can confirm it works fine if we use the correct managed library (1.57.1 in this case):

@DanWBR
Copy link
Author

DanWBR commented Dec 2, 2017

I'm closing this issue as it turned out to be the same as #377.

@DanWBR DanWBR closed this as completed Dec 2, 2017
@ghost ghost locked as resolved and limited conversation to collaborators Aug 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants