Tech Off Thread

6 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

images source problem in June CTP

Back to Forum: Tech Off
  • User profile image
    trun_gup

    feb CTP, may CTP uses BitMapImage to load images as image source. but it does not work with June CTP.

    How can we use external images in our project.

  • User profile image
    footballism

    trun_gup wrote:

    feb CTP, may CTP uses BitMapImage to load images as image source. but it does not work with June CTP.

    How can we use external images in our project.


    what kinda problem do you have with BitmapImage? BitmapImage just works great on my side, probably you should post the code causing the problem here.

    Sheva

  • User profile image
    trun_gup

    HI.. i am using Images folder that exists where the exe is placed.

    and i am using following code:

    img.Source=AssignImage("abc.png");

    public BitmapImage AssignImage(string relPath)
            {
                BitmapImage bmimgUser = new BitmapImage();
                bmimgUser.BeginInit();
                bmimgUser.UriSource = new Uri(@"Images/" + relPath, UriKind.Relative);
                bmimgUser.EndInit();
                return bmimgUser;
            }

    this is working fine for feb CTP and May CTP, but not works for june CTP

  • User profile image
    footballism

    probably the "abc.png" file is locked by some other programme on your pc, try using this instead:

    img.Source=AssignImage("abc.png");

    public BitmapImage AssignImage(string relPath)
            {
                BitmapImage bmimgUser = new BitmapImage();
                bmimgUser.BeginInit();
                bmimgUser.CacheOption =  BitmapCacheOption.OnLoad;
                bmimgUser.UriSource = new Uri(@"Images/" + relPath, UriKind.Relative);
                bmimgUser.EndInit();
                return bmimgUser;
            }

    Hopefully it helps

    PS: what kinda exception you get from this code?
    Sheva

  • User profile image
    trun_gup

    sheva.. i dont think so tht will solve my problem, though i will try and get back to u soon..

    thanks

  • User profile image
    footballism

    trun_gup wrote:
    sheva.. i dont think so tht will solve my problem, though i will try and get back to u soon..

    thanks

    trun_gup, you should check this, definitely it will solve your problem.

    Sheva

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.