BinaryImage.ContentBytes = GetByteArrayFromImage();
BinaryImage.Width =250;
BinaryImage.Height =320;
BinaryImage.ImageSizeMode = (ImageSizeMode)ComboBoxImageSizeMode.Value;
//................................
protected byte[] GetByteArrayFromImage() {
byte[] byteArray = null;
using(FileStream stream = new FileStream(Server.MapPath(ImageFileName), FileMode.Open, FileAccess.Read)) {
byteArray = new byte[stream.Length];
stream.Read(byteArray, 0, (int)stream.Length);
}
return byteArray;
}
BinaryImage.Width =250;
BinaryImage.Height =320;
BinaryImage.ImageSizeMode = (ImageSizeMode)ComboBoxImageSizeMode.Value;
//................................
protected byte[] GetByteArrayFromImage() {
byte[] byteArray = null;
using(FileStream stream = new FileStream(Server.MapPath(ImageFileName), FileMode.Open, FileAccess.Read)) {
byteArray = new byte[stream.Length];
stream.Read(byteArray, 0, (int)stream.Length);
}
return byteArray;
}
Yorumlar
Yorum Gönder