PictureBox拉伸图像在XP和Windows 7上有所不同

编程入门 行业动态 更新时间:2024-10-13 08:18:58
本文介绍了PictureBox拉伸图像在XP和Windows 7上有所不同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试为我的应用程序执行一些自动化测试.测试的一部分是对所选UI控件(主要是PictureBox和Label)进行位图比较.问题在于,对于相同的控件,XP上捕获的位图与Windows 7上捕获的位图不匹配.我需要在两台计算机上都进行测试,但是我不想为每个系统都使用单独的位图.系统或.NET中是否有任何设置可以强制控制在两个系统上的行为相同.还是某些低级问题(例如图形卡驱动程序等).知道如何处理吗?

解决方案

可能是由于这些系统的分辨率不同,请检查xp和7中的分辨率是否相同.我有类似的问题,尤其是在Windows XP计算机上渲染动画和某些WPF控件时.自定义控件特别麻烦.但是,在Windows 7环境中运行时,这些问题似乎消失了.据我所知,图形库在XP和Windows 7之间发生了根本性的变化,更不用说WPF将使用GPU渲染图像,这可能会导致旧版本的Windows出现问题. 有关GDI的维基百科

I am trying to implement some automation tests for my application. The part of tests is a bitmap comparison of selected UI controls (mostly PictureBox and Label). The problem is that the bitmap grabbed on XP does not match the bitmap grabbed on Windows 7 for the same control. I would need to run test on both machines, but I don''t want to have a separate bitmaps for each system. Are there any settings in system or .NET to force control to behave same on the both systems. Or is it some low level problem (like graphics card drivers or so). Any idea how to deal with it?

解决方案

It could be due to resolution differences in those systems, check that you have the same resolution in xp and 7.

I have had similar issues, particularly with rendering animations and certain WPF controls on a Windows XP machine. Custom controls are especially troublesome. When run in a Windows 7 environment however, these problems seem to disappear. As far as I know the graphics libraries radically changed between XP and Windows 7 not to mention that WPF will render images using the GPU, which may cause problems with older versions of Windows. Wiki atricle on GDI

更多推荐

PictureBox拉伸图像在XP和Windows 7上有所不同

本文发布于:2023-07-19 08:43:28,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1154818.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:有所不同   图像   PictureBox   Windows   XP

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!