locked
RenderTargetBitmap.LoadAsync fails with UIElement on a Flyout? (value out of range) RRS feed

  • Question

  • I have a Rectangle that contains a thumbnail that I render to a bitmap using RenderTargetBitmap.  When the Rectangle was a child of the main page grid this worked fine.  But now that it is a child control in a Flyout I get a "Value does not fall within the expected range" Exception from mscorlib.dll.  

    As a test I created a Rectangle directly on the main page grid that had the same Fill source as the (now) Flyout based Rectangle.  I passed it to RenderTargetBitmap.LoadAsync() instead and it worked fine.  As an additional test, I set it's opacity to 0%.  This time the whole IDE crashed.

    Can I fix this without having to resort to a duplicate Rectangle on the main page?

    UPDATE: For now I am moving the duplicate rectangle far off the client area with the following statement:

                rectDuplicateThumbnail.Margin = new Thickness(-1000, -1000, -1000 + rectVideomarkThumbnail.ActualWidth, -1000 + rectVideomarkThumbnail.ActualHeight);
    

    I'd still like to get rid of this kludge if possible.

    -- roschler



    • Edited by roschler Thursday, February 6, 2014 6:48 PM
    Thursday, February 6, 2014 6:14 PM

Answers

All replies