可以使用PointF来确定按钮的位置吗? [英] Can PointF be used to determine the position of a button?

查看:47
本文介绍了可以使用PointF来确定按钮的位置吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在与媒体播放器一起使用按钮.该按钮表示媒体播放器的currentPosition. (我知道这已经是媒体播放器对象的内置功能,但是我需要更大的显示区域.)它可以按计划工作,并允许用户 获取或设置currentPosition.我不满意的唯一方面是它在像素间跳动时会出现急促的运动.我以为我已经通过使用PointF(MyButton.Left = MyPointF.X)解决了问题,只是发现MyButton.Left值是 重新转换为整数(即​​以像素为单位的位置).

I am using a button together with a mediaplayer. The button represents the media player currentPosition. (I know this is already a built in feature of the media player object but I need a much bigger display area.) It works as planned and allows the user to get or set the currentPosition. The only aspect I'm not happy with is its jerky movement as it jumps from pixel to pixel. I thought I had solved the problem by using a PointF (MyButton.Left = MyPointF.X) only to discover that the MyButton.Left value is reconverted to an integer (i.e. a position in pixels).

是否可以使用少于一个像素的单位来精确定位按钮之类的对象?

Is there any way that objects like buttons can be positioned accurately using units of less than one pixel?

如果没有,是否还有其他物体可以比按钮更精确地定位?

If not, is there any other kind of object that can be positioned more accurately than a button?

任何帮助将不胜感激.

推荐答案

像素是屏幕上最小的可寻址位置(过去很高兴一个字符).

A pixel is the smallest addressable place on a screen (be happy in past it was a character).

因此,没有什么比这更准确了,但也许我误会了你.

Therefore nothing can be positioned more accurate than that, but maybe I misunderstand you.

您想用什么来担任该职位?

What would you want to use to adress the position?

您真的相信用户会在具有1000像素的屏幕上看到运动,我更明白您正在移动的像素比您想象的要多.

You really believe the user sees a movement on a screen with 1000 pixels, I more get the idea that you are moving more pixels than you think.

 请注意,要在屏幕上平滑移动,您需要一个计时器.

 Be aware that for a smooth way of moving over the screen you need a timer.

 


这篇关于可以使用PointF来确定按钮的位置吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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