Results 1 to 4 of 4

Thread: Unable to load Dynamic Images Everytime

  1. #1
    Join Date
    Feb 2009
    Posts
    40

    Unable to load Dynamic Images Everytime

    Can anyone tell me how SL2b dynamic change imageSource ? This is because I have some images which should get loaded when I access and different Images at each time this is not happening is there any other way to work with this,I wanted to try this out using PHP.

    Thanks for your help..

  2. #2
    Join Date
    Oct 2008
    Posts
    167

    Re: Unable to load Dynamic Images Everytime

    This is the solution I use:

    Image myImage = new Image();
    myImage.Source = new BitmapImage(new Uri("Assets/Images/star_yellow.png", UriKind.Relative));
    myCanvas.Children.Add(myImage);

    the image folder is located in the web project

    you should be able to use the solution for your background

  3. #3
    Join Date
    Dec 2008
    Posts
    161

    Re: Unable to load Dynamic Images Everytime

    Empty alt tag is acceptable, and alt is required for valid XHTML, so making it null is better than not having it.

    I don't know if this will make any difference or not, but try "echo" instead of "print" ...

    echo "<img id='Template_".$row{'id'}."' name='Template_".$row{'id'}."' src='".$row{'thumburl'}."' width='146' height='146' border='0' alt='' />";

    There is a slight speed difference (echo is faster), but it may also be a buffering thing between the server (sending the HTML) and the MySQL query.

    This might be another solution:

    PHP Code:
    $img_id=$row{'id'};
    $img_thumb=$row{'thumburl'};
    echo 
    "<img id='Template_".$img_id."' name='Template_".$img_id."' src='".$img_thumb."' width='146' height='146' border='0' alt='' />"

  4. #4
    Join Date
    Jan 2006
    Posts
    211

    Re: Unable to load Dynamic Images Everytime

    You may also make use of javascript A javascript array will generate a clickable picture. Put this where you want the images to appear.

    Code:
    <script type="text/javascript">
    var piclink = new Array(4);
    piclink[0] = "<a href = 'http://www.link1.htm'><img src='pic1.gif' alt='whatever' style='border:0'></a>";
    piclink[1] = "<a href = 'http://www.link2.htm'><img src='pic2.gif' alt='whatever' style='border:0'></a>";
    piclink[2] = "<a href = 'http://www.link3.htm'><img src='pic3.gif' alt='whatever' style='border:0'></a>";
    piclink[3] = "<a href = 'http://www.link4.htm'><img src='pic4.gif' alt='whatever' style='border:0'></a>";
    
    index = Math.floor(Math.random() * piclink.length);
    document.write(piclink[index]);
    
    </script>
    You can add as many as you want. Just give them the number that's next in sequence, eg if you want to add one more image make it piclink[4] And you will also need to change the number in new Array(4) to whatever your total is, eg for one more image it will be new Array(5).

    If you have to use Frontpage, you should do this in View Source HTML mode. Just copy and paste

Similar Threads

  1. Unable to load complete Images in Opera 11.50
    By ADELYN in forum Technology & Internet
    Replies: 4
    Last Post: 26-08-2011, 10:24 PM
  2. Nokia N8 Social App doesn't load images
    By Innis in forum Portable Devices
    Replies: 5
    Last Post: 11-02-2011, 10:27 PM
  3. How to Load/Display images with C#?
    By shivendra in forum Software Development
    Replies: 5
    Last Post: 22-01-2010, 07:35 PM
  4. Unable To Load Small Images Directly In MSIE
    By Adrina_g in forum Technology & Internet
    Replies: 5
    Last Post: 04-01-2010, 08:42 AM
  5. Firefox don't load images!
    By Drogbaa in forum Windows Software
    Replies: 4
    Last Post: 30-03-2009, 05:50 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,301,591.09957 seconds with 17 queries