本文介绍了如何比较2个HDC的取舍误差为1%的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我很难在另一个HDC中搜索一个HDC.如果像素都相同,我就可以做到.
如何设置比较值,让我说1%的错误?
这是每个像素的比较逻辑部分:

Hello all,

I am having a hard time, searching one HDC within another HDC. I have been able to do it if the pixels are all the same.
How do I set the comparison to give me an error of lets say 1%?
Here is the the portion of the compare logic for each pixel:

for(int y = 0; y < Rect_To_Compare.bottom; ++y) {
    for(int x = 0; x < Rect_To_Compare.right; ++x) {
        COLORREF Color = ::GetPixel(DlgDC, (x + Rect_To_Compare.left), (y + Rect_To_Compare.top) );
        COLORREF ColorToCompare = ::GetPixel(BitmapDC,x,y);
        if(Color != ColorToCompare) {
            result = false;
        }
    }
}



任何帮助将不胜感激.



Any help would be greatly appreciated.

推荐答案


这篇关于如何比较2个HDC的取舍误差为1%的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-19 20:54