为什么一时能成功上存,一时不可以成功上传
出现错误代码系 A generic error occurred in GDI+.
下面系截图
出现错误代码系 A generic error occurred in GDI+.
下面系截图
解决方案 »
- 打开excel文件后另存的新文件很多格式与原文件不一样?
- 求教,关于在Web服务在web Form开发下的一个难题
- 异常详细信息: System.Security.SecurityException: 请求失败。
- IFramen 页面和页面之间的问题??
- 如何将一个二进制(流)写入到一个文件? 为什么我写入到文件后,里面什么都没有??
- 如何刷新用户控件中的内容?
- 如果一个用户控件被多次调用,每次都会将不同的数据源绑定到用户控件里面的子控件,请问如何实现?
- 在ASP.NET MVC3中,<%与MVC4中的@
- 偶尔出现Invalid operation. The connection is closed.这种错误,求解
- 请问怎么在Codebinde里使用窗体用户控件?
- 登录代码没错吧为什么提示
- 新手求助:初学ASP.NET,搭建一个B/S架构系统,用UDP通信,问题:UDP通信如何用C#在ASP.NET实现
{
Bitmap image = new Bitmap(maxWidth, maxHeight);
Graphics g = Graphics.FromImage(image); g.Clear(Color.White); Image orgimg = Image.FromFile(OriginFilePath); //获取了小图 int x = 0, y = 0;
if (orgimg.Width < maxWidth)
{
x = (maxWidth - orgimg.Width) / 2;
}
if (orgimg.Height < maxHeight)
{
y = (maxHeight - orgimg.Height) / 2;
}
g.DrawImage (orgimg, x, y); g.Dispose();
if (System.IO.File.Exists(TargetFilePath))
{
System.IO.File.Delete(TargetFilePath);
}
image.Save(TargetFilePath); image.Dispose(); orgimg.Dispose(); }