C#Graphics.RotateTransform可在localhost上运行,但不能在远程服务器上运行 [英] C# Graphics.RotateTransform works on localhost, but not on remote server

查看:120
本文介绍了C#Graphics.RotateTransform可在localhost上运行,但不能在远程服务器上运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

它可以在我的机器上工作...

It works on my machine...

我在ASP.NET Web主机上使用C#图形方法时遇到问题.

I have a problem with using a C# Graphics method on my ASP.NET web host.

我正在将两个地图图钉组合到一个图像中.我加载一个空的针脚图像,并在其上面写一个数字.然后,我将其中两个进行了组合,分别旋转了15度和-15度.通过我的本地主机Web服务器运行看起来不错:

I'm combining two map pins into a single image. I load an empty pin image and write a number on top of it. I then combine two of these, having rotated one 15 degrees and the other -15 degrees. It looks fine running through my localhost web server:

预期的http://harriyott.com/images/stackoverflow/expected.png

我将其上传到我的共享服务器,而我得到了它:

I upload this to my shared server, and I get this instead:

实际http://harriyott.com/images/stackoverflow/actual.png

我这样加载图像:

var g = Graphics.FromImage(image);

旋转图像的线是:

g.RotateTransform(angle);

我确定这一定是某个设置,但是我没有运气找到它.

I'm sure this must be a setting somewhere, but I've had no luck finding it.

推荐答案

确保在旋转图像时仍然有文件流可以打开图像,因为它很可能正在访问原始图像以执行对其进行改造.

Ensure that you still have the file stream to load the image open when you do the rotate on it, as it is likely to be accessing the original image to perform a transformation on it.

不确定是否可以解决这个问题,但是值得一试!

Not sure if that will solve this one, but worth a shot!

这篇关于C#Graphics.RotateTransform可在localhost上运行,但不能在远程服务器上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆