C# WriteableBitmap不';不能在Linux上渲染,但可以在UWP和Wasm上工作

C# WriteableBitmap不';不能在Linux上渲染,但可以在UWP和Wasm上工作,c#,xaml,cross-platform,uno-platform,C#,Xaml,Cross Platform,Uno Platform,我试图使用WriteableBitmap对象在UI上呈现一个红色框。该应用程序在UWP上按预期工作: 在使用Gtk.Skia的Linux上,没有显示任何内容(共享相同的代码): 以下是C#代码: 公共密封部分类主页面:第页 { 公共主页() { this.InitializeComponent(); 油漆(); } 私人空间涂料() { WriteableBitmap _wb=新的WriteableBitmap(100100); byte[]imageArray=新字节[_wb.PixelH

我试图使用WriteableBitmap对象在UI上呈现一个红色框。该应用程序在UWP上按预期工作:

在使用Gtk.Skia的Linux上,没有显示任何内容(共享相同的代码):

以下是C#代码:

公共密封部分类主页面:第页
{
公共主页()
{
this.InitializeComponent();
油漆();
}
私人空间涂料()
{
WriteableBitmap _wb=新的WriteableBitmap(100100);
byte[]imageArray=新字节[_wb.PixelHeight*_wb.PixelWidth*4];
对于(int i=0;i
XAML代码:

<Page
x:Class="test.Uno.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">

<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
    <Image x:Name="test" VerticalAlignment="Top" />
</Grid>

Skia上尚未提供对WriteableBitmap的支持。这是我的建议


更新(2020-09-18):在Uno.UI 3.1.0-dev.364及更高版本中,Skia GTK/WPF可以使用WriteableBitmap。

在Skia上还没有对WriteableBitmap的支持。这是我的建议

更新(2020-09-18):可在Uno.UI 3.1.0-dev.364及更高版本中为Skia GTK/WPF提供可写比图。

<Page
x:Class="test.Uno.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">

<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
    <Image x:Name="test" VerticalAlignment="Top" />
</Grid>