RenderTargetBitmap RenderAsync Value does not fall within the expected range

我怕爱的太早我们不能终老 提交于 2019-12-24 01:47:09

问题


Using this guide: http://social.technet.microsoft.com/wiki/contents/articles/20648.using-the-rendertargetbitmap-in-windows-store-apps-with-xaml-and-c.aspx

I thought this would be a walk in the park until I got the error on this section:

await renderTargetBitmap.RenderAsync(grid_editor);

Here is my 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>

It only has text and a image in it, for a test I had it not load the image I wanted into it and it still does not work. same error.

Code:

RenderTargetBitmap renderTargetBitmap = new RenderTargetBitmap();
            await renderTargetBitmap.RenderAsync(grid_editor);

            image_preview.Source = renderTargetBitmap;

来源:https://stackoverflow.com/questions/35642908/rendertargetbitmap-renderasync-value-does-not-fall-within-the-expected-range

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!