This project is read-only.

WriteableBitmapRenderExtension with Grids, Canvas, Lists?

Mar 18, 2014 at 2:26 PM
I am trying to render a grid containing two images to a WritableBitMapImage via the WritableBitmapRenderExtensions.Render() function.
I am getting the following error:
"Falscher Parameter.\r\n\r\n'uri': Only http, https and ftp schemes are allowed."
Here is my Grid:
 <Grid x:Name="RootLayout">
            <Image x:Name="imageElement" Stretch="Fill"/>
            <Image VerticalAlignment="Center" x:Name="imgOverlay" HorizontalAlignment="Center" 
               Height="Auto" Margin="121,152,146,364" Width="200"
               ManipulationDelta="imgOverlay_ManipulationDelta_1" PointerPressed="imgOverlay_PointerPressed" PointerReleased="imgOverlay_PointerReleased">
                        <ScaleTransform x:Name="scaleTransform" ScaleX="1"/>
                        <TranslateTransform x:Name="translate"/>
And here is how i try to render it:
WriteableBitmap wbmp = await WinRTXamlToolkit.Composition.WriteableBitmapRenderExtensions.Render(fe);
How do i get this to work? Are grids not supported? Which UIElements are supported?

Thanks in advance.
Mar 26, 2014 at 8:34 PM
Can you check if adding "ms-appx:/" at the beginning of the Image.Source would help fix it? I have a hunch this piece of code in WriteableBitmapFromBitmapImageExtension.FromBitmapImage() might be causing it:
            if (originalString.StartsWith("ms-appx:/"))
                string installedFolderImageSourceUri = originalString.Replace("ms-appx:/", "");
                await target.LoadAsync(installedFolderImageSourceUri);
                var file = await WebFile.SaveAsync(source.UriSource, ApplicationData.Current.TemporaryFolder);
                await target.LoadAsync(file);
                await file.DeleteAsync(StorageDeleteOption.PermanentDelete);
Mar 27, 2014 at 3:18 PM
I've set the image source. But I am still getting the same error.
<Image VerticalAlignment="Center" x:Name="imgOverlay" HorizontalAlignment="Center" 
               Height="Auto" Width="200"
               Source="ms-appx://Assets/HariboBears/bear01_big.png" ManipulationMode="All"          
Mar 27, 2014 at 5:11 PM
Have you tried debugging it?