Image.Save在Windows 7上不起作用 [英] Image.Save not work on Windows 7

查看:110
本文介绍了Image.Save在Windows 7上不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请帮助我...
我想将tiff类型转换为jpeg,反过来,它.但是
Image.Save方法在 Windows 7 中不起作用????

Please help me...
I want convert tiff type to jpeg and conversely, it. but
the Image.Save method not work in Windows 7 ????

推荐答案

它确实起作用.您模糊且毫无意义的帖子很难解读,但我最好的猜测是,您正在尝试将图片保存到您无权保存的路径.如果您认为不是这样,请尝试发布代码,告诉我们您要保存的位置,发生什么情况,等等.如果不起作用,则很可能抛出异常.考虑一下消息中所说的内容,因为如果您将其发布,则很可能会告诉您消息的含义.
It does actually work. Your vague and meaningless post is hard to decipher, but my best guess is, you''re trying to save an image to a path you don''t have permission to save to. If you think that''s not it, try posting code, telling us where you are saving to, what happens, etc. If it doesn''t work, odds are good it''s throwning an exception. consider what the message says, because if you do post it, odds are good we will tell you it means what it says.


请在此处查看:
http://stackoverflow.com/questions/6101830/image- save-can-not-over-write-images-in-win7 [ http://support.microsoft.com/kb/2028610 [ http://stackoverflow.com/questions/6101830/image- save-can-not-over-write-images-in-win7 [
Please see here:
http://stackoverflow.com/questions/6101830/image-save-can-not-over-write-images-in-win7[^]
http://support.microsoft.com/kb/2028610[^]
http://stackoverflow.com/questions/6101830/image-save-can-not-over-write-images-in-win7[^]


[澄清后回答我对问题的评论:]

在Windows 7上,此路径("D:\")可能是非法的.您可以编辑此目录的权限,但不能使您的代码有效.如果在某些计算机上执行它,您怎么知道"D:"甚至存在? (在我的一台计算机上,甚至不存在"C:";这不是必须的.)

通常,在任何情况下都不会使用硬编码的文件路径.在所有情况下,都应在运行时根据用户提供的数据,配置数据,装配位置,特殊文件夹"(针对每个用户或针对所有用户")中的数据进行计算,因此可以使用System.Environment.GetFolderPath(Environment.SpecialFolder),请参见:
http://msdn.microsoft.com/en-us/library/system.environment. getfolderpath.aspx [ ^ ],
http://msdn.microsoft.com/en-us/library/system.environment. specialfolder.aspx [ ^ ].

—SA
[Answering after clarifications in reply to my comments to the questions:]

This path ("D:\") can be illegal on Windows 7. You can edit permissions for this directory, but it cannot make your code valid. If you execute it on some computer, how can you know that "D:" even exists? (On one of my computers, even "C:" does not exist; it''s not a must.)

Generally, there are no cases where hard-coded file path can be useful. In all cases, it should be calculated during run time out of user-supplied data, data from configuration, assembly location, "special folders", per user or for "all users", so you can use System.Environment.GetFolderPath(Environment.SpecialFolder), please see:
http://msdn.microsoft.com/en-us/library/system.environment.getfolderpath.aspx[^],
http://msdn.microsoft.com/en-us/library/system.environment.specialfolder.aspx[^].

—SA


这篇关于Image.Save在Windows 7上不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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