locked
Maximal size of SurfaceImageSource RRS feed

  • Question

  • Is there a fix constraint of the size of SurfaceImageSource and VirtualImageSource controls?

    I tried to create a SurfaceImageSource with a 10.000 width, but the first BeginDraw calls throws an Exception with a message "Windows.UI.Xaml.Controls.Frame.NavigationFailed was unhandled.". The same happens with VirtualImageSource. (I don't know the exact limit, though 7000 pixel width works properly).

    Is there any workaround to this problem, or I have to use multiple VirtualImageSources if I want to display content so wide?

    Tuesday, June 5, 2012 4:11 PM

Answers

  • Since you're basically creating giant DirectX surfaces, you may just be running out of video memory depending on the hardware.  If your content is larger than the screen's dimensions (generally between 1024 and 2560 pixels wide) then the recommended approach is to use a VirtualSurfaceImageSource inside a ScrollViewer control. 

    The ScrollViewer should be sized to the screen's width or less, which will allow the VirtualSurfaceImageSource to virtualize its content.  The VirtualSurfaceImageSource can then be larger - it should support sizes much larger than 10000px wide.

    Tuesday, June 5, 2012 7:58 PM

All replies

  • Since you're basically creating giant DirectX surfaces, you may just be running out of video memory depending on the hardware.  If your content is larger than the screen's dimensions (generally between 1024 and 2560 pixels wide) then the recommended approach is to use a VirtualSurfaceImageSource inside a ScrollViewer control. 

    The ScrollViewer should be sized to the screen's width or less, which will allow the VirtualSurfaceImageSource to virtualize its content.  The VirtualSurfaceImageSource can then be larger - it should support sizes much larger than 10000px wide.

    Tuesday, June 5, 2012 7:58 PM
  • Thanks for the answer. It turns out, the problem wasn't the size of the ImageSource per se, but the size of the updateRect I passed to the BeginDraw call.
    Wednesday, June 6, 2012 8:25 AM
  • By the way, If the xaml application has no ScrollViewer. And I have set the width and height of image control as smaller than the parameters we post into the VirtualSurfaceImageSource. The image will be drawn fully instead of a part of. So I want to ask, the size of image control must be full-size ?

    Tuesday, December 31, 2013 4:05 AM