Tuesday, February 26, 2013

Way to get Height and Width of image

Following code is used to get the height and width of image

//In case of images stored in sever.
System.Drawing.
Image objImage = System.Drawing.Image.FromFile(@"D:\a.jpg");


int width = objImage.Width;


int height = objImage.Height;

//In case of validating image before uploadbyte[] imgdata = System.IO.File.ReadAllBytes(@"D:\a.jpg");

System.IO.
MemoryStream memoryStream = new System.IO.MemoryStream(imgdata);

System.Drawing.
Image objStreemImage = System.Drawing.Image.FromStream(memoryStream);


int widthMemoryStream = objStreemImage.Width;


int heightMemoryStream = objStreemImage.Height;


Thanks
Mahesh

Wednesday, February 20, 2013

Run code ready or load of DOM

<script type="text/javascript">
      $(window).load(function () {
     //Do action after load
      });
   </script>

<script type="text/javascript">
      $(document).ready(function () {
     //Do action after document is ready
      });
   </script>

Thanks
Mahesh K Sharma