How can I make dynamic loading of images?

Discussion in 'Plugin Development' started by F13Mim, March 3, 2012.

  1. F13Mim

    F13Mim Portal Member

    Joined:
    March 3, 2012
    Messages:
    7
    Likes Received:
    0
    Ratings:
    +0 / 0
    Home Country:
    Russian Federation Russian Federation
    How can I make dynamic loading of images?

    -- xaml
    <Image Source="{Binding Path=Img}"/>

    -- CS
    protected readonly AbstractProperty _imgProperty = new WProperty(typeof(object), null);

    public AbstractProperty ImgProperty
    {
    get { return _imgProperty; }
    }

    public object Img
    {
    get { return (object)_imgProperty .GetValue(); }
    set { _imgProperty.SetValue(value); }
    }

    Give an example from the gallery of pictures.


     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. Albert
    • Premium Supporter

    Albert MP2 Developer

    Joined:
    February 18, 2008
    Messages:
    1,297
    Likes Received:
    1,125
    Gender:
    Male
    Occupation:
    Dipl.-Inform.
    Location:
    Freiburg im Breisgau, Germany
    Ratings:
    +1,130 / 1
    Home Country:
    Germany Germany
    - CS
    Img = "radio.png";
     
  4. F13Mim

    F13Mim Portal Member

    Joined:
    March 3, 2012
    Messages:
    7
    Likes Received:
    0
    Ratings:
    +0 / 0
    Home Country:
    Russian Federation Russian Federation
    I get a lot of images over the Internet.
    I do not understand how to realize code?
     
  5. F13Mim

    F13Mim Portal Member

    Joined:
    March 3, 2012
    Messages:
    7
    Likes Received:
    0
    Ratings:
    +0 / 0
    Home Country:
    Russian Federation Russian Federation
    I get different images with different sizes, and I display in <Image/>.
    How can this be done?
     
  6. morpheus_xx
    • Team MediaPortal

    morpheus_xx Lead Dev MP2

    Joined:
    March 24, 2007
    Messages:
    11,090
    Likes Received:
    4,766
    Ratings:
    +6,826 / 11
    Home Country:
    Germany Germany
    Show System Specs
  7. F13Mim

    F13Mim Portal Member

    Joined:
    March 3, 2012
    Messages:
    7
    Likes Received:
    0
    Ratings:
    +0 / 0
    Home Country:
    Russian Federation Russian Federation
    I'm more interested in how to works MediaPortal.UI.SkinEngine.ContentManagement.ContentManager
    the class. And why ContentManager.Instance.GetTexture (img.GetBuffer (), "temp.png");
    when adding images to ContentManager then does not work
    AvatarImage = "temp.png"; display the new image.
     
  8. morpheus_xx
    • Team MediaPortal

    morpheus_xx Lead Dev MP2

    Joined:
    March 24, 2007
    Messages:
    11,090
    Likes Received:
    4,766
    Ratings:
    +6,826 / 11
    Home Country:
    Germany Germany
    Show System Specs
    If I understand you correctly, you want to show images from web inside MP2 gui?

    Than it should be enough to assign either a local filename as <Image Source="c:\file.png"> or a web URL <Image Source="http://..de/file.png">. In principle you should not deal with the "low level" ContentManager directly, but use the MPF controls.
     
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!