timheuer / callisto

A control toolkit for Windows 8 XAML applications. Contains some UI controls to make it easier to create Windows UI style apps for the Windows Store in accordance with Windows UI guidelines.
http://timheuer.com/blog/archive/2012/05/31/introducing-callisto-a-xaml-toolkit-for-metro-apps.aspx
Other
338 stars 108 forks source link

TiltEffect blink at first click on item. #194

Open TheXby opened 11 years ago

TheXby commented 11 years ago
  1. Click on item -> item is tilted and blinking -> application go to another page.
  2. Go back.
  3. Click on item -> tilt work perfect.
timheuer commented 11 years ago

I am confused. What does blink mean?

infidelkea commented 11 years ago

I've seen this too. Have a small image that's being tilted. It seems when it's clicked for the first time the image disappears momentarily. After that it works fine.

On Tue, May 7, 2013 at 5:18 AM, Tim Heuer notifications@github.com wrote:

I am confused. What does blink mean?

— Reply to this email directly or view it on GitHubhttps://github.com/timheuer/callisto/issues/194#issuecomment-17519720 .

TheXby commented 11 years ago

Tim, this mean that after i click on tilted image, image goes white for a moment and then goesn normar.

martinsuchan commented 11 years ago

I have this problem too and it's quite annoying. Reproduction scenario and detailed description is here: http://stackoverflow.com/questions/16775385/how-to-remove-image-blinking-when-using-tilt-from-callisto-for-controls-with-ima

PaulEmmanuelSotir commented 11 years ago

I had the same issue and I found a workaround. The blinking may be due to the first instanciation of BitmapCache in "PrepareControlForTilt" method of Tilt class:

private static bool PrepareControlForTilt(FrameworkElement element, Point centerDelta, Pointer p)
{
...
_originalCacheMode[element] = element.CacheMode;
element.CacheMode = new BitmapCache();
... 
}

Setting 'CacheMode' property of your Image to 'BitmapCache' seems to solve the problem:

<StackPanel HorizontalAlignment="Left" VerticalAlignment="Top"
            calistoEffect:Tilt.IsTiltEnabled="True">
    ...
    <Image Source="ms-appx:/Resources/Images/MyPicture.png"
           Width="100" Height="100"
           CacheMode="BitmapCache"/>
</StackPanel>
dotMorten commented 11 years ago

Thanks Paul for identifying the issue and finding the workaround. That gives me something to go on to perhaps make a more permanent fix.

ManuelRauber commented 10 years ago

@timheuer when will this be fixed?