Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



Unable to load Dynamic Images Everytime

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 18-03-2009
Member
 
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..

Reply With Quote
  #2  
Old 18-03-2009
Member
 
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
Reply With Quote
  #3  
Old 18-03-2009
Member
 
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='' />"
Reply With Quote
  #4  
Old 18-03-2009
Member
 
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
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


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


All times are GMT +5.5. The time now is 11:26 PM.