半电路计数器图 [英] half circuit counter drawing

查看:39
本文介绍了半电路计数器图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好
我想绘制一个看起来像汽车速度计数器的计数器,该计数器的光标根据C#Windows应用程序中的测量值而变化.
提前thnx:)

Hi all
I want to draw a counter that is look like car speed counters that have a cursor change depending on a measured value in C# windows app.
thnx in advance :)

推荐答案

因此,请在Visual Studio中创建一个UserControl并执行该操作!
您将需要:

1)几个属性:最小值,最大值,当前值:任何更改都应强制重新绘制.
2)处理控件的Paint事件:绘制背景(如果有),然后绘制指针,其角度取决于Current属性与Min和Max属性之间的距离.

我建议您从一条直线开始,最小值在左边,最大值在右边,而当前值是最小值之间的一条线.这样一来,您便可以使用测试框架,以确保它可以正常工作,然后再进行更复杂的操作.

哪一部分给您带来了问题?
So, create a UserControl in visual studio and do it!
You will need:

1) A couple of properties: Min, Max, Current values: any change should force a re-draw.
2) To handle the Paint event of the control: Draw the background (if any), then the pointer, with an angle depending on the distance of the Current property from the Min and Max properties.

I would suggest that you start with just a straight line, with Min at the left, Max at teh right, and current as a line between Min at it''s value. That will let you get the testing framework in place to ensure it works before you move on to more complex bits.

What part of this is giving you a problem?


这篇关于半电路计数器图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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