[solved] - Plugin: ImageSourceExtensions

Discussion in 'Plugin Development' started by Brownard, December 11, 2015.

  1. Brownard
    • Team MediaPortal

    Brownard Development Group

    Joined:
    March 21, 2007
    Messages:
    1,913
    Likes Received:
    786
    Gender:
    Male
    Ratings:
    +1,319 / 1
    Home Country:
    United Kingdom United Kingdom
    Show System Specs
    This plugin adds a new type of ImageSource to MediaPortal 2 which allows skinners to implement smooth transitions and delayed loading of images.
    The ImageSourceWrapper inherits from MultiImageSource so has all of its properties plus:
    • Delay: The amount of time in seconds to delay the loading of images, useful for avoiding loading lots of images when scrolling quickly
    • DelayInOut: Whether the delay should apply when transitioning to or from null
    • Source: The primary image source, can either be a path to an image or an ImageSource that has a Uri property (MultiImageSource or BitmapImageSource)
    • FallbackSource: The image source to use if the primary source cannot be loaded, can either be a path to an image or an ImageSource that has a Uri property (MultiImageSource or BitmapImageSource)
    Source: https://github.com/MediaPortal/MediaPortal-2/tree/PLUGIN_ImageSourceExtensions

    Installation: Extract the attached zip to the MP2 client plugin directory



    Example usage:
    Code (XML):
    1.  
    2. <Screen
    3.    xmlns:ie="clr-namespace:ImageSourceExtensions;assembly=ImageSourceExtensions"
    4.    >
    5. ...
    6. <Image x:Name="FanArtImageBackground" VerticalAlignment="Stretch" Stretch="UniformToFill" Grid.Row="0" Grid.Column="0">
    7.     <Image.Source>
    8.         <ie:ImageSourceWrapper Delay="0.5" DelayInOut="true" Transition="transitions\dissolve" TransitionDuration="0.5"
    9.                        Source="{Binding Source={StaticResource FanArtBackgroundModel}, Path=ImageSource, Converter={StaticResource FanArtImageSourceConverter}, ConverterParameter=FanArt;1920;1080;False}"
    10.                        FallbackSource="FallbackFanart.png" />
    11.     </Image.Source>
    12. </Image>
     

    Attached Files:

    Last edited: December 12, 2015
    • Thank You! Thank You! x 5
    • Like Like x 1
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. ge2301
    • Team MediaPortal

    ge2301 MP2 Design

    Joined:
    January 11, 2014
    Messages:
    6,155
    Likes Received:
    1,554
    Gender:
    Male
    Occupation:
    Automotive Industry
    Location:
    Stuttgart (But living abroad)
    Ratings:
    +2,338 / 2
    Home Country:
    Germany Germany
    Wow Brownard, you are a genius! (y):p:D It feels like beeing in a different world.
    All transitions are happening smoothly now. I think we have to bind the plugin, so it's installed ondefault!
     
    • Like Like x 2
  4. ge2301
    • Team MediaPortal

    ge2301 MP2 Design

    Joined:
    January 11, 2014
    Messages:
    6,155
    Likes Received:
    1,554
    Gender:
    Male
    Occupation:
    Automotive Industry
    Location:
    Stuttgart (But living abroad)
    Ratings:
    +2,338 / 2
    Home Country:
    Germany Germany
    A quick and dirty recording. Unfortunately I've no better software at the moment. And also I don't want to load tons of MB to here.
    You can see, that also the delay is working perfectly. Means, scrolling quickly makes the FanArts not being loaded and preventing performance issues.
     

    Attached Files:

    • test.avi
      File size:
      41.4 MB
      Uploaded:
      December 11, 2015
      Views:
      95
    • Like Like x 1
  5. ge2301
    • Team MediaPortal

    ge2301 MP2 Design

    Joined:
    January 11, 2014
    Messages:
    6,155
    Likes Received:
    1,554
    Gender:
    Male
    Occupation:
    Automotive Industry
    Location:
    Stuttgart (But living abroad)
    Ratings:
    +2,338 / 2
    Home Country:
    Germany Germany
    @morpheus_xx
    Can you add the plugin into the standard installation package? Actually I have already adjusted the skins accordingly and I'm going to push the changes.
     
    • Agree Agree x 1
  6. Lehmden
    • Premium Supporter

    Lehmden Retired Team Member

    Joined:
    December 17, 2010
    Messages:
    11,847
    Likes Received:
    2,146
    Gender:
    Male
    Location:
    Lehmden
    Ratings:
    +3,618 / 28
    Home Country:
    Germany Germany
    Show System Specs
    Hi.
    This definitely is a big improvement in user experience, great(y)
    Can't wait to see this "live" on my setup.
    BTW... Do I need to adjust my Theme too or is this done in the main BV skin?
     
  7. ge2301
    • Team MediaPortal

    ge2301 MP2 Design

    Joined:
    January 11, 2014
    Messages:
    6,155
    Likes Received:
    1,554
    Gender:
    Male
    Occupation:
    Automotive Industry
    Location:
    Stuttgart (But living abroad)
    Ratings:
    +2,338 / 2
    Home Country:
    Germany Germany
    You need to adjust your theme in default-background.xaml according to Brownards guide above.
     
    Last edited: December 12, 2015
  8. Lehmden
    • Premium Supporter

    Lehmden Retired Team Member

    Joined:
    December 17, 2010
    Messages:
    11,847
    Likes Received:
    2,146
    Gender:
    Male
    Location:
    Lehmden
    Ratings:
    +3,618 / 28
    Home Country:
    Germany Germany
    Show System Specs
    Ok, thanks. Will do that asap
     
  9. ge2301
    • Team MediaPortal

    ge2301 MP2 Design

    Joined:
    January 11, 2014
    Messages:
    6,155
    Likes Received:
    1,554
    Gender:
    Male
    Occupation:
    Automotive Industry
    Location:
    Stuttgart (But living abroad)
    Ratings:
    +2,338 / 2
    Home Country:
    Germany Germany
    Sorry, I miswrote. It must be default-background.xaml
     
  10. Lehmden
    • Premium Supporter

    Lehmden Retired Team Member

    Joined:
    December 17, 2010
    Messages:
    11,847
    Likes Received:
    2,146
    Gender:
    Male
    Location:
    Lehmden
    Ratings:
    +3,618 / 28
    Home Country:
    Germany Germany
    Show System Specs
    Thanks. I've tried it in Image-background.xaml but this did not work. Now I know why...;)
     
  11. Lehmden
    • Premium Supporter

    Lehmden Retired Team Member

    Joined:
    December 17, 2010
    Messages:
    11,847
    Likes Received:
    2,146
    Gender:
    Male
    Location:
    Lehmden
    Ratings:
    +3,618 / 28
    Home Country:
    Germany Germany
    Show System Specs
    Wow...
    Got it working. :D Fantastic improvement, thanks a lot...
     
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!