Binding To a Pré-Load Image Collection?

2 posts, 0 answers
  1. Joao Santos
    Joao Santos avatar
    5 posts
    Member since:
    Mar 2010

    Posted 20 Apr 2010 Link to this post

    Im tring to binding my pre-loaded image Collection to CoverFlow but images is loding state forever?

    there is my code:

    OpenFileDialog dlg = new OpenFileDialog(); 
                dlg.Filter = "Arquivos (*.jpg)|*.jpg"
                dlg.Multiselect = true
                dlg.ShowDialog(); 
                ImageData ImageData = new ImageData(); 
                BitmapImage bitmap = new BitmapImage(); 
     
                ImageTools.IO.Jpeg.JpegDecoder decoder = new ImageTools.IO.Jpeg.JpegDecoder(); 
     
                List<ImageTools.Image> ImageList = new List<ImageTools.Image>(); 
     
                foreach (FileInfo finfo in dlg.Files) 
                { 
                    ImageTools.Image img = new ImageTools.Image(); 
                    decoder.Decode(img, finfo.OpenRead()); 
                    img = ImageTools.Image.Resize(img, 120, 90, new ImageTools.Filtering.NearestNeighborResizer()); 
                    ImageList.Add(img);   
                } 
     
                 
                List<System.Windows.Controls.Image> FinalImageList = new List<System.Windows.Controls.Image>(); 
     
                foreach(ImageTools.Image img in ImageList) 
                { 
                    System.Windows.Controls.Image i = new System.Windows.Controls.Image(); 
                    i.Width = img.Width; 
                    i.Height = img.Height; 
                    i.Source = img.ToBitmap(); 
                    i.Margin = new Thickness(5,5,5,5); 
                    i.Source = img.ToBitmap(); 
                    FinalImageList.Add(i); 
                } 
     
                CoverFlow.ItemsSource = FinalImageList; 
            } 
     

    and my xaml:

    <UserControl 
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
        xmlns:telerikNavigation="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation" 
        x:Class="PhotoStudio.MainPage" 
        Width="640" Height="480"
     
        <Grid x:Name="LayoutRoot" Background="White"
            <Button x:Name="btnAddImage" Height="25" HorizontalAlignment="Left" Margin="8,8,0,0" VerticalAlignment="Top" Width="179" Content="Adicionar Imagens" Click="btnAddImage_Click"/> 
            <telerikNavigation:RadCoverFlow x:Name="CoverFlow" Height="435" Margin="8,0,8,8" VerticalAlignment="Bottom"/> 
        </Grid> 
    </UserControl> 

    Help plz!!!






  2. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 22 Apr 2010 Link to this post

    Hello Joao,

     What I would suggest you is to wrap your images in ContentPresenters. This will stop the Loading indication of the CoverFlow control.

    Hope this helps!

    Sincerely yours,
    Miroslav Nedyalkov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. DevCraft banner
Back to Top