Cropping an image with PHP or Javascript -


i have image called 'progressbar.png'. there way crop image, php or javascript, each time page loads image crop depending on progress percentage , loaded page. example, if image 200px wide, @ 25% progress image cropped 50px wide.

make div, set background of div image, , manipulate div's width whatever want.

html:

<div id="progressbar"></div> 

css:

#progressbar{ background:url(progressbar.png) top left; height:progressbarheightpx; } 

javascript:

document.getelementbyid('progressbar').style.width='50px' 

or done in php printing out width directly div:

<div id="progressbar" width="<?php echo $percent_done*200;?>px"></div> 

Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c# - Copy ObservableCollection to another ObservableCollection -

All overlapping substrings matching a java regex -