Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > Avalon

Bug: BitMap effect causes refresh failure.

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 04-11-2006   #1 (permalink)
Philippe Lavoie
Guest


 

Bug: BitMap effect causes refresh failure.

Hi

In my code I had a list box item template with something like the
following in it

<Grid Width="171" Height="150" x:Name="ProductItem" Margin="5">
<Rectangle x:Name="ItemBackground" RadiusX="0" RadiusY="0"
Fill="#331195CC" Width="Auto" Height="75" Margin="15.5,0,0.5,0"
Stroke="#FF1B97CB" VerticalAlignment="Top" MinWidth="0"/>
<ContentPresenter Width="60" Height="Auto"
HorizontalAlignment="Left" MinHeight="0" Margin="4,19,0,8"
x:Name="ImagePresenter" RenderTransformOrigin="0.5,0.5"
Content="{Binding Path=Content, RelativeSource='{RelativeSource
TemplatedParent}'}" ClipToBounds="False" >
<ContentPresenter.BitmapEffect>
<DropShadowBitmapEffect ShadowDepth="5"/>
</ContentPresenter.BitmapEffect> </ContentPresenter>
</Grid>

And


<DataTemplate DataType="{x:Type src:Ski}">
<Image Width="Auto" Height="130" Source="{Binding ImageUri}"
HorizontalAlignment="Center" VerticalAlignment="Center"
x:Name="SkiProductImage" RenderTransformOrigin="0.5,0.5" IsEnabled="True">

</Image>
</DataTemplate>

This caused the images of the products to be hidden (not shown).
However, putting the bitmap effect inside the datatemplate instead of
with the ContentPresenter fixes the refresh problems.

It was HARD to find a workaround...

Hopefully this will be fixed soon.

Phil


My System SpecsSystem Spec
Old 04-11-2006   #2 (permalink)
Rahul Patil
Guest


 

RE: Bug: BitMap effect causes refresh failure.

Hi Phil,
Can you clarify your scenario further:

For instance, the following works just fine: Update the slider and the
notice that the content does get refreshed.
<WrapPanel Width="300" Height="300"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Background="blue"
>

<WrapPanel.Resources>
<Image x:Key="Img1" Source="Earth.bmp" Opacity="{Binding
ElementName=Sld1, Path=Value}" />
<OuterGlowBitmapEffect x:Key="glow"/>
</WrapPanel.Resources>
<Grid Width="171" Height="150" x:Name="ProductItem" Margin="5">
<Rectangle x:Name="ItemBackground" RadiusX="0" RadiusY="0"
Fill="#331195CC" Width="Auto" Height="75" Margin="15.5,0,0.5,0"
Stroke="#FF1B97CB" VerticalAlignment="Top" MinWidth="0"/>
<ContentPresenter Width="70" Height="Auto"
HorizontalAlignment="Left" MinHeight="0" Margin="4,19,0,8"
x:Name="ImagePresenter" RenderTransformOrigin="0.5,0.5"
Content="{Binding ElementName=Sld1,Path=Value}"
ClipToBounds="False" BitmapEffect="{StaticResource glow}">

</ContentPresenter>
<Slider Name="Sld1" Value="3"/>
</Grid>
</WrapPanel>


"Philippe Lavoie" wrote:

> Hi
>
> In my code I had a list box item template with something like the
> following in it
>
> <Grid Width="171" Height="150" x:Name="ProductItem" Margin="5">
> <Rectangle x:Name="ItemBackground" RadiusX="0" RadiusY="0"
> Fill="#331195CC" Width="Auto" Height="75" Margin="15.5,0,0.5,0"
> Stroke="#FF1B97CB" VerticalAlignment="Top" MinWidth="0"/>
> <ContentPresenter Width="60" Height="Auto"
> HorizontalAlignment="Left" MinHeight="0" Margin="4,19,0,8"
> x:Name="ImagePresenter" RenderTransformOrigin="0.5,0.5"
> Content="{Binding Path=Content, RelativeSource='{RelativeSource
> TemplatedParent}'}" ClipToBounds="False" >
> <ContentPresenter.BitmapEffect>
> <DropShadowBitmapEffect ShadowDepth="5"/>
> </ContentPresenter.BitmapEffect> </ContentPresenter>
> </Grid>
>
> And
>
>
> <DataTemplate DataType="{x:Type src:Ski}">
> <Image Width="Auto" Height="130" Source="{Binding ImageUri}"
> HorizontalAlignment="Center" VerticalAlignment="Center"
> x:Name="SkiProductImage" RenderTransformOrigin="0.5,0.5" IsEnabled="True">
>
> </Image>
> </DataTemplate>
>
> This caused the images of the products to be hidden (not shown).
> However, putting the bitmap effect inside the datatemplate instead of
> with the ContentPresenter fixes the refresh problems.
>
> It was HARD to find a workaround...
>
> Hopefully this will be fixed soon.
>
> Phil
>
>

My System SpecsSystem Spec
Old 04-19-2006   #3 (permalink)
Philippe Lavoie
Guest


 

Re: Bug: BitMap effect causes refresh failure.

The issue is really due to the use of a style applied to the default
listboxitem type which then piggy backs on a datatemplate for the actual
content presentation.

If you just use regular markup to do it, it works fine.

Phil




Rahul Patil wrote:
> Hi Phil,
> Can you clarify your scenario further:
>
> For instance, the following works just fine: Update the slider and the
> notice that the content does get refreshed.
> <WrapPanel Width="300" Height="300"
> xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
> Background="blue"
> >

> <WrapPanel.Resources>
> <Image x:Key="Img1" Source="Earth.bmp" Opacity="{Binding
> ElementName=Sld1, Path=Value}" />
> <OuterGlowBitmapEffect x:Key="glow"/>
> </WrapPanel.Resources>
> <Grid Width="171" Height="150" x:Name="ProductItem" Margin="5">
> <Rectangle x:Name="ItemBackground" RadiusX="0" RadiusY="0"
> Fill="#331195CC" Width="Auto" Height="75" Margin="15.5,0,0.5,0"
> Stroke="#FF1B97CB" VerticalAlignment="Top" MinWidth="0"/>
> <ContentPresenter Width="70" Height="Auto"
> HorizontalAlignment="Left" MinHeight="0" Margin="4,19,0,8"
> x:Name="ImagePresenter" RenderTransformOrigin="0.5,0.5"
> Content="{Binding ElementName=Sld1,Path=Value}"
> ClipToBounds="False" BitmapEffect="{StaticResource glow}">
>
> </ContentPresenter>
> <Slider Name="Sld1" Value="3"/>
> </Grid>
> </WrapPanel>
>
>
> "Philippe Lavoie" wrote:
>
>
>>Hi
>>
>>In my code I had a list box item template with something like the
>>following in it
>>
>><Grid Width="171" Height="150" x:Name="ProductItem" Margin="5">
>> <Rectangle x:Name="ItemBackground" RadiusX="0" RadiusY="0"
>>Fill="#331195CC" Width="Auto" Height="75" Margin="15.5,0,0.5,0"
>>Stroke="#FF1B97CB" VerticalAlignment="Top" MinWidth="0"/>
>> <ContentPresenter Width="60" Height="Auto"
>>HorizontalAlignment="Left" MinHeight="0" Margin="4,19,0,8"
>>x:Name="ImagePresenter" RenderTransformOrigin="0.5,0.5"
>>Content="{Binding Path=Content, RelativeSource='{RelativeSource
>>TemplatedParent}'}" ClipToBounds="False" >
>> <ContentPresenter.BitmapEffect>
>> <DropShadowBitmapEffect ShadowDepth="5"/>
>> </ContentPresenter.BitmapEffect> </ContentPresenter>
>></Grid>
>>
>>And
>>
>>
>><DataTemplate DataType="{x:Type src:Ski}">
>> <Image Width="Auto" Height="130" Source="{Binding ImageUri}"
>>HorizontalAlignment="Center" VerticalAlignment="Center"
>>x:Name="SkiProductImage" RenderTransformOrigin="0.5,0.5" IsEnabled="True">
>>
>> </Image>
>> </DataTemplate>
>>
>>This caused the images of the products to be hidden (not shown).
>>However, putting the bitmap effect inside the datatemplate instead of
>>with the ContentPresenter fixes the refresh problems.
>>
>>It was HARD to find a workaround...
>>
>>Hopefully this will be fixed soon.
>>
>>Phil
>>
>>

My System SpecsSystem Spec
Old 04-24-2006   #4 (permalink)
Rahul Patil
Guest


 

Re: Bug: BitMap effect causes refresh failure.

Is this related to the other thread titled "Opacity modifier doesn't work
inside a datatrigger for ...", I have answered that separately.

Thanks for your input!

-Rahul Patil

"Philippe Lavoie" wrote:

> The issue is really due to the use of a style applied to the default
> listboxitem type which then piggy backs on a datatemplate for the actual
> content presentation.
>
> If you just use regular markup to do it, it works fine.
>
> Phil
>
>
>
>
> Rahul Patil wrote:
> > Hi Phil,
> > Can you clarify your scenario further:
> >
> > For instance, the following works just fine: Update the slider and the
> > notice that the content does get refreshed.
> > <WrapPanel Width="300" Height="300"
> > xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
> > xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
> > Background="blue"
> > >

> > <WrapPanel.Resources>
> > <Image x:Key="Img1" Source="Earth.bmp" Opacity="{Binding
> > ElementName=Sld1, Path=Value}" />
> > <OuterGlowBitmapEffect x:Key="glow"/>
> > </WrapPanel.Resources>
> > <Grid Width="171" Height="150" x:Name="ProductItem" Margin="5">
> > <Rectangle x:Name="ItemBackground" RadiusX="0" RadiusY="0"
> > Fill="#331195CC" Width="Auto" Height="75" Margin="15.5,0,0.5,0"
> > Stroke="#FF1B97CB" VerticalAlignment="Top" MinWidth="0"/>
> > <ContentPresenter Width="70" Height="Auto"
> > HorizontalAlignment="Left" MinHeight="0" Margin="4,19,0,8"
> > x:Name="ImagePresenter" RenderTransformOrigin="0.5,0.5"
> > Content="{Binding ElementName=Sld1,Path=Value}"
> > ClipToBounds="False" BitmapEffect="{StaticResource glow}">
> >
> > </ContentPresenter>
> > <Slider Name="Sld1" Value="3"/>
> > </Grid>
> > </WrapPanel>
> >
> >
> > "Philippe Lavoie" wrote:
> >
> >
> >>Hi
> >>
> >>In my code I had a list box item template with something like the
> >>following in it
> >>
> >><Grid Width="171" Height="150" x:Name="ProductItem" Margin="5">
> >> <Rectangle x:Name="ItemBackground" RadiusX="0" RadiusY="0"
> >>Fill="#331195CC" Width="Auto" Height="75" Margin="15.5,0,0.5,0"
> >>Stroke="#FF1B97CB" VerticalAlignment="Top" MinWidth="0"/>
> >> <ContentPresenter Width="60" Height="Auto"
> >>HorizontalAlignment="Left" MinHeight="0" Margin="4,19,0,8"
> >>x:Name="ImagePresenter" RenderTransformOrigin="0.5,0.5"
> >>Content="{Binding Path=Content, RelativeSource='{RelativeSource
> >>TemplatedParent}'}" ClipToBounds="False" >
> >> <ContentPresenter.BitmapEffect>
> >> <DropShadowBitmapEffect ShadowDepth="5"/>
> >> </ContentPresenter.BitmapEffect> </ContentPresenter>
> >></Grid>
> >>
> >>And
> >>
> >>
> >><DataTemplate DataType="{x:Type src:Ski}">
> >> <Image Width="Auto" Height="130" Source="{Binding ImageUri}"
> >>HorizontalAlignment="Center" VerticalAlignment="Center"
> >>x:Name="SkiProductImage" RenderTransformOrigin="0.5,0.5" IsEnabled="True">
> >>
> >> </Image>
> >> </DataTemplate>
> >>
> >>This caused the images of the products to be hidden (not shown).
> >>However, putting the bitmap effect inside the datatemplate instead of
> >>with the ContentPresenter fixes the refresh problems.
> >>
> >>It was HARD to find a workaround...
> >>
> >>Hopefully this will be fixed soon.
> >>
> >>Phil
> >>
> >>

>

My System SpecsSystem Spec
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
Merge one bitmap onto another in vb Jon Jacobs .NET General 0 05-27-2008 11:41 AM
bitmap jd Vista file management 3 12-09-2007 04:34 PM
bitmap compression Bez Vista music pictures video 0 11-19-2007 10:32 AM
How to get the bitmap image of a control Patrice Avalon 4 11-01-2007 06:04 PM
I want to be able to create a new bitmap... Max Rockatanski Vista General 3 01-24-2007 01:04 PM


Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51