C# Graphics.RotateTransform works on localhost, but not on remote server

懵懂的女人 提交于 2019-12-11 03:18:26

问题


It works on my machine...

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

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:

Expected http://harriyott.com/images/stackoverflow/expected.png

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

Actual http://harriyott.com/images/stackoverflow/actual.png

I load the image thus:

var g = Graphics.FromImage(image);

The line to rotate the image is:

g.RotateTransform(angle);

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


回答1:


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!



来源:https://stackoverflow.com/questions/2561901/c-sharp-graphics-rotatetransform-works-on-localhost-but-not-on-remote-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!