-
-
-
-
-
-
-
-
- public void update_picture(string fileFoldUrl, string fileName, string filePath, int _width, int _height)
- {
- byte[] zp = this.load_pictMemory(filePath);
-
- MemoryStream ms = new MemoryStream(zp);
-
- System.Drawing.Image img = System.Drawing.Image.FromStream(ms);
-
- Bitmap btp = new Bitmap(img, _width, _height);
-
- DirectoryInfo dti = new DirectoryInfo(fileFoldUrl);
-
- FileInfo[] fis = dti.GetFiles();
-
- string fileUrl = fileFoldUrl + fileName;
-
- btp.Save(fileUrl);
- }
-
-
-
-
-
-
- public byte[] load_pictMemory(string filePath)
- {
- byte[] pictData = null;
-
- FileInfo fi = new FileInfo (filePath);
-
- if (fi.Exists)
- {
- pictData = new byte[fi.Length];
-
- FileStream fs = new FileStream(filePath, FileMode.Open, FileAccess.ReadWrite);
-
- BinaryReader br = new BinaryReader(fs);
-
- br.Read(pictData, 0, Convert.ToInt32(fi.Length));
-
- fs.Dispose();
- }
- else
- {
- HttpContext.Current.Response.Write("<script language='javascript'>alert('没有找到你所指定的图片')</script>");
- }
- return pictData;
- }
posted on
2009-08-25 14:21
米高佐敦
阅读(
560)
评论()
编辑
收藏
举报