G
Garro
In order to correctly scale existing photos (keeping the existing aspect
ratio) of different sizes I need to be able to use the height and width of
an image. While I have been successful in accessing those values as type
unit I have been unable to use them in an "if" statement or to do
calculations using them and I have been working on trying to convert them to
a type (int,decimal) that is compatible with these functions. To that end I
have been trying to come up with a way to convert an object of type
System.Web.UI.WebControls.Unit to an object of type int, or decimal, and I
haven't been able to make it happen. Each time I try the error message in
the subject of this post is returned. Any help would be greatly
appreciated. I have snipped a couple of my attempt and placed them
below.....
// create new Image() object for each Photo
Image objImage = new Image();
Int32 imgHeight = Convert.ToInt32(objImage.Height);
// create new Image() object for each Photo
Image objImage = new Image();
Int32 imgHeight = objImage.Height;
ratio) of different sizes I need to be able to use the height and width of
an image. While I have been successful in accessing those values as type
unit I have been unable to use them in an "if" statement or to do
calculations using them and I have been working on trying to convert them to
a type (int,decimal) that is compatible with these functions. To that end I
have been trying to come up with a way to convert an object of type
System.Web.UI.WebControls.Unit to an object of type int, or decimal, and I
haven't been able to make it happen. Each time I try the error message in
the subject of this post is returned. Any help would be greatly
appreciated. I have snipped a couple of my attempt and placed them
below.....
// create new Image() object for each Photo
Image objImage = new Image();
Int32 imgHeight = Convert.ToInt32(objImage.Height);
// create new Image() object for each Photo
Image objImage = new Image();
Int32 imgHeight = objImage.Height;