Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/backbone.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# RenderTargetBitmap RenderAsync值不在预期范围内_C#_Xaml_Win Universal App - Fatal编程技术网

C# RenderTargetBitmap RenderAsync值不在预期范围内

C# RenderTargetBitmap RenderAsync值不在预期范围内,c#,xaml,win-universal-app,C#,Xaml,Win Universal App,使用本指南: 我以为这是在公园里散步,直到我在这一部分中发现了错误: await renderTargetBitmap.RenderAsync(grid_editor); 这是我的XAML <Grid Name="grid_editor" Width="500" Height="500"> <Image x:Name="image_snap_preview" HorizontalAlignment="Stretch" Verti

使用本指南:

我以为这是在公园里散步,直到我在这一部分中发现了错误:

await renderTargetBitmap.RenderAsync(grid_editor);
这是我的XAML

<Grid Name="grid_editor" Width="500" Height="500">
                        <Image x:Name="image_snap_preview" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Source="Assets/login/images/image (1).JPG"/>
                        <TextBlock Name="txt_123" Text="This text is on top of the image" FontSize="40" TextWrapping="Wrap" Margin="70"/>
                    </Grid>

加载网格后需要调用您的代码。与
RenderTargetBitmap renderTargetBitmap = new RenderTargetBitmap();
            await renderTargetBitmap.RenderAsync(grid_editor);

            image_preview.Source = renderTargetBitmap;