DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/)
-   JavaScript / DHTML / AJAX (http://www.daniweb.com/forums/forum117.html)
-   -   calculate image property in javascript (http://www.daniweb.com/forums/thread14223.html)

Deepa Nov 18th, 2004 2:37 am
calculate image property in javascript
 
how to calculate the heigth,width and size of a image using javascript

js-x.com Nov 24th, 2004 7:50 am
Re: calculate image property in javascript
 
if:
<img src="abc.gif" name=myimg>

then:
* document.myimg.width
* document.myimg.src

same syntax for:
border, complete, height, vspace, lowsrc, name, src, vspace, width

methods:
handleEvent()

events:
onAbort, onError, onKeyDown, onKeyPress, onKeyUp, onLoad

1000s of Free Javascripts

Deepa Nov 25th, 2004 12:09 am
Re: calculate image property in javascript
 
if the image src is in a text box,then how to calculate width,height,Size of then image

js-x.com Nov 27th, 2004 5:04 pm
Re: calculate image property in javascript
 
Quote:

Originally Posted by Deepa
if the image src is in a text box,then how to calculate width,height,Size of then image


Post the code of your image.


www.js-x.com
www.js-x.com/forum/

Deepa Nov 29th, 2004 6:39 am
Re: calculate image property in javascript
 
this the code
from this path how to calculate the image height and width using javascript
Photo path:<input class="Message" id="filePicture" type="file" name="file" runat="server">

js-x.com Nov 29th, 2004 8:32 am
Re: calculate image property in javascript
 
you can not.

this code is going to accept an image file which has not been posted to the server yet, nor is it running inside of the DOM.

If you had the image in your page <img src="blah.gif" name="abc"> then it would be accessable inside of the DOM.

There are PHP and Perl [etc] programs that can accept the posted images and determine the sizes...


All times are GMT -4. The time now is 2:26 am.

Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC