How to programmaticly load images from directory on server

10 posts, 0 answers
  1. Eugeniy Tunikov
    Eugeniy Tunikov avatar
    8 posts
    Member since:
    Mar 2010

    Posted 09 Mar 2010 Link to this post

    Hei. I have a directory on server which has images which amount varies.
    I need to load the images and show them.

    Right now my coverflow does not load images dynamicly. Here is the code

     

    <telerikNavigation:RadCoverFlow x:Name="CoverFlow" OffsetY="100" ItemsSource="{Binding}" VerticalAlignment="Center" ItemScale="0.85" >     
       
    <telerikNavigation:RadCoverFlow.ItemTemplate>     
     <DataTemplate>   
    <local:AlbumCover Width="225" Height="225" />     
    </DataTemplate>   
     </telerikNavigation:RadCoverFlow.ItemTemplate>  </telerikNavigation:RadCoverFlow>   
     
    <ScrollBar telerik:StyleManager.Theme="Office_Black" Width="600" Height="20" Margin="0,2,0,0" Orientation="Horizontal" SmallChange="1" LargeChange="3" Minimum="0" Grid.Row="1" Value="{Binding ElementName=CoverFlow, Path=SelectedIndex, Mode=TwoWay}"   
    Maximum="{Binding ElementName=CoverFlow, Path=ItemsSource.Count, Converter={StaticResource IntToIntValueConverter}, ConverterParameter=-1}" /> </Grid> 
     
     

    In the code behind it loads images like this

     

    new DataItem ()   
    {  
    ImageSource = new Uri("Images/03.png", UriKind.Relative), Genre = "Jazz"Title = "The Most Relaxing Jazz Standards in the Universe", },  

     

     

     

     

    Like i said the images must be loaded dymamicly. First i need to read what files are in folder and then push them to silverlight app.
    Please give me advise.

    Thanks

     

     

     

     

     

     

  2. Eugeniy Tunikov
    Eugeniy Tunikov avatar
    8 posts
    Member since:
    Mar 2010

    Posted 10 Mar 2010 Link to this post

    Do i need to create a generic handler?
  3. DevCraft banner
  4. Eugeniy Tunikov
    Eugeniy Tunikov avatar
    8 posts
    Member since:
    Mar 2010

    Posted 11 Mar 2010 Link to this post

    Can i do like this?

    Uri uri = new Uri(@"http://localhost:6519/getfile.ashx", UriKind.Absolute);  
                BitmapImage bi = new BitmapImage(uri);  
                ObservableCollection<BitmapImage> bitmaps = new ObservableCollection<BitmapImage>();  
                bitmaps.Add(bi);  
                this.coverFlow.ItemsSource = bitmaps
  5. Eugeniy Tunikov
    Eugeniy Tunikov avatar
    8 posts
    Member since:
    Mar 2010

    Posted 11 Mar 2010 Link to this post

    Ok i have done this and pictures are showing

     

    Uri uri = new Uri(@"http://localhost:6519/getfile.ashx", UriKind.Absolute);  
                BitmapImage bi = new BitmapImage(uri);  
                ObservableCollection<BitmapImage> bitmaps = new ObservableCollection<BitmapImage>();  
                bitmaps.Add(bi);  
                bitmaps.Add(bi);  
                bitmaps.Add(bi);  
                bitmaps.Add(bi);  
                bitmaps.Add(bi);  
                bitmaps.Add(bi);  
                bitmaps.Add(bi);  
                bitmaps.Add(bi);  
     
                this.coverFlow.ItemsSource = bitmaps

    BUT!! now i cannot navigate pictures to the right and left. Its just static. Any idea why?

     

     

  6. Hristo Borisov
    Admin
    Hristo Borisov avatar
    298 posts

    Posted 15 Mar 2010 Link to this post

    Hello Eugeniy Tunikov,

    Do you use an ItemTemplate property to define the child template of your CoverFlow? Try setting in xaml the following template which should resolve your problem:

    <navigation:RadCoverFlow.ItemTemplate>
        <DataTemplate>
            <Grid Width="128" Height="128">
                <Image Source="{Binding}" />
            </Grid>
        </DataTemplate>
    </navigation:RadCoverFlow.ItemTemplate>

    If you still have any issues, please do not hesitate to contact us again.

    Greetings,
    Hristo Borisov
    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.
  7. pallavi
    pallavi avatar
    2 posts
    Member since:
    Feb 2011

    Posted 14 Mar 2011 Link to this post

    Hi Hristo Borisov,

    I do have a same problem in loading images on CoverFlow from Server location.
    i followed the below steps, but in my case i can just see the image loading cursor for e long time
    but i cant see the image.

    Dont know what could be the error. 
    can you please insist me on this.

    Regards,
    Pallavi

  8. Stephen Rouse
    Stephen Rouse avatar
    23 posts
    Member since:
    Feb 2005

    Posted 26 Apr 2011 Link to this post

    Any answer to this? I have a similar issue! The imaging loading cursor just continues on and on and on....without showing the images.
  9. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 28 Apr 2011 Link to this post

    Hello,

    The problems could be caused by one of the folloing scenarios:
    1. The path to the image is incorrect
    2. The image is on a different location/domain and there is no correct cross domain policy file on the server
    3. The image is on the Internet (and there is a correct cross domain policy file), but the application is started without a web application (directly using the Silverlight project)

    You could debug this problem using a web debugging tool like fiddler.

    If none of these helps, please prepare us a sample project and send it via support ticket. This could help us better investigate what the problem is and help you resolve it.

    Kind regards,
    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
  10. Stephen Rouse
    Stephen Rouse avatar
    23 posts
    Member since:
    Feb 2005

    Posted 14 May 2011 Link to this post

    I had policy files etc, added a converter to use the full (Absolute) URL and this solved the issue, I tried switching of the Anti-Virus and firewalls on the client side, this seemed to resolve the issue for a while, but the issue returned when I was downloading in excess of 15 images. Using Absolute address works everytime, regardless of the number of images.
  11. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 16 May 2011 Link to this post

    Hello Stephen,

     It\s good to here that you found a solution of this problem.

    Regards,
    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
Back to Top
DevCraft banner