Windows 7引发Graphics.ScaleTransform(infinity,1.0)的异常 [英] Windows 7 is throwing Exception for Graphics.ScaleTransform(infinity,1.0)

查看:160
本文介绍了Windows 7引发Graphics.ScaleTransform(infinity,1.0)的异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在XP中,相同的Graphics.ScaleTransform(infinity,1.0)该行将在不引发异常的情况下执行,但是在Windows 7中,它将引发异常,如何避免这种情况?

In XP the same Graphics.ScaleTransform(infinity,1.0)This line will execute without raising exception but in windows 7 it throws an exception how can i avoid this?

推荐答案

什么是无限"?
看起来Windows 7是好人".



What is ''infinity''?
Looks like Windows 7 is the ''good guy''.



myes写道:

它引发了异常,我该如何避免呢?

it throws an exception how can i avoid this?


我们称它为"catch".


We call it ''catch''.


按无穷大缩放图形上下文是没有意义的.您可能应该再看一遍代码,看看为什么要创建该值,如果它确实有效,则图形绘制部分应该做一些不同的事情(限制比例尺或不绘制任何内容).在这种情况下抛出异常是绝对正确的.
Scaling a graphics context by infinity makes no sense. You should probably have a look at the code a bit further up and see why that value is being created, and if it is actually valid, your graphics drawing section should do something different (cap the scale or not draw anything). It is absolutely correct to throw an exception in that case.


这篇关于Windows 7引发Graphics.ScaleTransform(infinity,1.0)的异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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