不同机器的像素问题 [英] Pixel Issue with different machines

查看:79
本文介绍了不同机器的像素问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,



不知道在哪里问这个。



我有一个对话框应用程序正在做一些屏幕报废。

我已经能够在一台机器上工作了。我已经重新配置了具有相同分辨率的第二台机器。我在第二台机器上遇到问题。



问题是,让我们说我们有一个9 x 9的网格。在第一台机器上,我已经能够得到9 x 9的完整网格及其中的所有像素,因为它被该机器的用户填充。



然而,第二台机器就是我的位置遇到问题的是,当用户填满网格时,我无法获得完整的9 x 9网格。我得到一个局部网格。它可能只是前20或40,但从第一台机器开始,我从未能够满81。



有人可以帮忙,可能会发生什么。



到目前为止我尝试了什么:短物理设备之间的差异,我已经重新安装了操作系统并将两台机器设置为相同的桌面分辨率。



我已经能够发送鼠标点击两个应用程序我唯一的问题是从第二台机器上取回像素。



任何想法?



修改为添加代码:



Hello,

Not sure where to ask this.

I have a dialog application that is doing some screen scrapping.
I have been able to get it to work on 1 machine. I have reconfigured a second machine with the same resolution. I am having an issue on the second machine.

The issue is, Lets say we have a grid of 9 x 9. On the first machine I have been able to get the full grid of 9 x 9 with all the pixels from it, as it gets filled by the user of that machine.

However , second machine is where I am having issues with is, I am unable to get full 9 x 9 grid as the user fills the grid out. I get a partial grid. It could be only first 20 or 40 but never been able to get full 81 as I get from the first machine.

Can someone please help, what could be happening.

What I have tried so far: Short of the differences between physical devices, I have re-installed the operating system and set both machines to the same desktop resolution.

I have been able to send mouse clicks to both applications. My only issue is getting the pixel back from the second machine.

Any Ideas?

Modified to add the code:

hWnd is a handle to the target window.
HDC DlgDC;
COLORREF Color;
DlgDC = ::GetDC(hWnd);
Color = ::GetPixel(DlgDC,x[a],y[b]);
if (Color == RGB(213,7,11))
{
Result = 2;
	}                                                          
	if (Color == RGB(3,16,255))
	{
		Result = 1;
	}
	if (Color == RGB(23,211,12))
	{
		Result = 0;
	
::ReleaseDC(hWnd, DlgDC);
DeleteObject(DlgDC);

推荐答案

这不是桌面分辨率。决议无关紧要。这是桌面屏幕的大小(以像素为单位)。看到差异?



当然,设置不同系统的相同屏幕尺寸将是一个完全跛脚,甚至不总是可能,因为纵横比是不同的。无论您做什么,都可以在当前系统上获得桌面大小。具体如下:

http://msdn.microsoft.com/en-us/library/windows/desktop/ms633504%28v=vs.85%29.aspx [ ^ ]。



-SA
This is not "desktop resolution". Resolution is majorly irrelevant. This is the size of the desktop screen in pixels. See the difference?

Of course, setting identical screen size of different systems would be a total lame, and not even always possible, because aspect ratio are different. Whatever you do, you can get the desktop size on a current system. This is how:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms633504%28v=vs.85%29.aspx[^].

—SA


这篇关于不同机器的像素问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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