locked
In WinRT, loading images in listbox by enabling VirtualizingStackPanel.VirtualizationMode as Recyling, image get blurred while scrolling the listbox

    Question

  • I have added items in listbox as 50 images by enabling VirtualizingStackPanel.VirtualizationMode as Recyling. By scrolling the listbox, images in the listbox get blurred. Any one have an idea on this to resolve the issue ?


    Monday, April 27, 2015 1:31 PM

Answers

  • Hi Elavarasan,

    Tried your code and I don't know what you mean by blur, perhaps a screenshot?

    I use the image which is 41K with 600*300 and I did not see any blur on those images..However if I use a really big image which is 20M, I can see the blur, but CacheMode does solve the problem. Personally I think it related with GPU also the XAML render engine.

    I would suggest you follow the remark section of the doc: CacheMode property to do some profiling if necessary

    --James


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, April 28, 2015 8:06 AM
    Moderator

All replies

  • Hi Elavarasan,

    Did you set BitmapCache mode for these images? And you mentioned about VirtualizationMode, does it mean if we disable the Virtualization, the image will not get blurred? How about the ListView?

    Not quite sure if the blur you mentioned is caused by Virtualization, perhaps share some code with us for further analysis is recommended.

    --James


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, April 28, 2015 3:13 AM
    Moderator
  • Hi Jamles,

    Thanks for your solution.

    After setting BitMapCache to image, the image blurred issue get resolved.

    Virtualization Mode:

    yes, by disabling Virtualization in the listbox  the images not get blurred.  Please find the definition of listbox from below.

    <ListBox Name="listbox" Width="100">
                <ListBox.ItemsPanel>
                    <ItemsPanelTemplate>
                        <VirtualizingStackPanel VirtualizingStackPanel.VirtualizationMode="Recycling" />
                    </ItemsPanelTemplate>
                </ListBox.ItemsPanel>
            </ListBox>

    And from code behind, i have add the images into the above listbox like below.

    for (int i = 0; i < 50; i++)
                {
                    var Iconpath = Path.Combine("Assets\\Fastrack.png");
                    Image imagecell = new Image();
                    var IPath = Path.Combine(Package.Current.InstalledLocation.Path, Iconpath);
                    Image Ipathimg = new Image();
                    Ipathimg.Source = new BitmapImage(new Uri(IPath));
                    imagecell.Source = Ipathimg.Source;                
    
                    //added the image to listbox
                    this.listbox.Items.Add(imagecell);
                }

    Now by scrolling the listbox means, image get blurred.

    Regards,

    Elavarasan M

    Tuesday, April 28, 2015 4:32 AM
  • Hi Elavarasan,

    Tried your code and I don't know what you mean by blur, perhaps a screenshot?

    I use the image which is 41K with 600*300 and I did not see any blur on those images..However if I use a really big image which is 20M, I can see the blur, but CacheMode does solve the problem. Personally I think it related with GPU also the XAML render engine.

    I would suggest you follow the remark section of the doc: CacheMode property to do some profiling if necessary

    --James


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, April 28, 2015 8:06 AM
    Moderator