Is there a way to draw pixel arrays dynamically on Image control in MAUI? #7644
Unanswered
evhenii-komar
asked this question in
Q&A
Replies: 2 comments
-
use skiasharp or use platform method custom a control like https://github.com/xtuzy/MauiPlayground/tree/master/MauiLib/CustomControls to draw |
Beta Was this translation helpful? Give feedback.
0 replies
-
same question and also i can update WriteableBitmap content(with memory address) with hight fps. I'm confused if it has the same function on MAUI. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi! For every frame, I have a 4-bytes BGRA pixel array to update my Image control. However, I can't find a way to update it in MAUI frequently. Tens times per second.
In WinUI3 I use an Image control with WriteableBitmap as a source. I update WriteableBitmap.PixelBuffer as a stream for every frame and it works fine. WinUI3 pseudo-code is:
In MAUI I tried this approach:
Xaml:
<Image x:Name="MyImage" HeightRequest="200"/>
Code:
with no luck. ImageSource wants a stream from a graphics file, not a stream of a pixels byte array.
I also saw how to use GraphicsView with Canvas, however, it looks uncompleted. Microsoft.Maui.Graphics.Platform namespace is inaccessible on Windows and there are no examples for Windows.
Even if I could use:
MAUI awaits that stream is a stream of a graphics file from resources or disk, not a pixels array with channels of color. I think MAUI WebView does something similar to show web pages. Is there a way to draw pixel arrays dynamically on Image control or are there some other surfaces to do it? Could someone direct me, please?
Beta Was this translation helpful? Give feedback.
All reactions