DockPanel Width Limited by Bitmap effect?

Hi all,
Ive been struggling to make a dockpanel component wider than around 900 pixels - im using one as a header on my application - it therefore needs to expand to fill the full width of the application.

It seems to be limited by the application of a BitmapEffect drop shadow. For example with the followign code the dockpanel downt paint anywhere near 1700 pixels wide, but when i comment out the bitmap effect element the panel fills the width of the screen as it should. I really need the drop shadow though! I think this may be a bug in WPF. By the way - the Border is inside a Canvas....

<Border Width="1700" Margin="39, 0, 0, 0" Canvas.Left="0" Canvas.Top="120" BorderThickness="2" Height="26" Background="#2B7ABF">
<Border.BorderBrush >
<SolidColorBrush Color="White" />
</Border.BorderBrush>

<Border.BitmapEffect>
<DropShadowBitmapEffect Color="Black" ShadowDepth="3" Opacity="0.7">
</DropShadowBitmapEffect>
</Border.BitmapEffect>
</Border>


Answer this question

DockPanel Width Limited by Bitmap effect?

  • igoro1975

    Hi Scott,

    Thanks for your input.

    I was under the impression that it was fixed with the Feb CTP. Can you clarify which CTP you are using

    Some background:

    Due to perf issues, we originally decided to force a max size. The user feedback suggested we remove this upper bound. When we removed the upper bounds, users started to hit Out of memory conditions when large scales were applied.

    The next fix was to use the size of the screen, and then process the effect. Any updates to the visual itself, like scrolling etc, should automatically update the effect.

    The following seems to work fine with the recent bits we have here.

    <Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" >
    <ScrollViewer HorizontalScrollBarVisibility="Visible">
    <TextBox Width="1900" Margin="39, 0, 0, 0" Canvas.Left="0" Canvas.Top="120" BorderThickness="2" Height="26" Background="#2B7ABF">
                <TextBox.BitmapEffect>
                        <BlurBitmapEffect />
                </TextBox.BitmapEffect>
    </TextBox>

    </ScrollViewer>
    </Page>

     

     

     

     

     


  • Kars Blom

    Right - i thought it must be a bug.

    thanks for confirming that. I guess i'll just wait and see what the future ctp's bring.

    Regards,
    Scott.

  • APEXnow

    This has been reported as a bug for several months. I have not checked the status of this recently, as the bug tracker is not very informative. It actually gets worse. As you scale the situation the maximum size varies. It appears that the size limit has to do with the native size of an element after transformation applied to the pre-transformation area. As the size of an element goes up after transformation, the area visible in the bitmap effect goes down. I imagine that this means that the buffer for the bitmap is allocated using the size of the untransformed shape, applied to the transformed area, then scaled down for display.

  • Philip York

    Hi there Rahul,
    The issue does indeed appear to have been fixed in the February CTP! The bug was originally noticed in the January CTP.

    Glad that issue is sorted,
    Thanks,
    Scott.

    "You threw a monkey in the sea " Alan Partridge 1999.




  • DockPanel Width Limited by Bitmap effect?