Graphics.DrawLine的覆盖 [英] Override of Graphics.DrawLine

查看:375
本文介绍了Graphics.DrawLine的覆盖的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图 @override 显卡的的DrawLine 类,但我不能确定这是否可能?

I seek to @override the DrawLine method of the Graphics class, but I am unsure if this is possible?

我试图把一个验证的方法,以便它停止在某一个变量Y.图纸,我将提供,有效地增加了方法的新参数。

I seek to put a validation in the method so that it stops drawing at a certain Y variable that I would provide, effectively adding a new parameter to the method.

任何人有上覆盖一些经验或建议具体的方法是什么?

Anyone got some experience or advice on overriding that specific method?

我不确定这rproblem,所以我不知道我是否可以简单地做 @覆盖键,然后给它一个验证,因为它是绘制单独的像素点。

I am unsure about this rproblem so I dont know if I can simply do @Override and then give it a validation as it is plotting the separate pixel points.

感谢。

推荐答案

这是不可能正常的代码来替换方法的目的不是要被替换/重写。

It is not possible for normal code to replace method that is not designed to be replaced/overriden.

您可以


  • 预处理(即ILDASM /修改/ ILASM)所有调用组件使用新的方法

  • 用您自己的

  • 使用替代System.Drawing中装配一些现有的框架,使覆盖这些方法样痣或的如果你需要它的单元测试假货的。

  • pre-process (i.e. ILDASM/modify/ILASM) all calling assemblies to use your new method
  • replace System.Drawing assembly with your own
  • use some existing framework that allows to override such methods like Moles or Fakes if you need it for unit testing.

这篇关于Graphics.DrawLine的覆盖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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