我已经构建了一个简单的应用程序,它将网格线应用于图像,或者只是简单的颜色用作桌面墙纸。这个想法是桌面图标可以安排在网格内。问题在于,取决于比我理解的更多的东西,像素的实际间距似乎在系统之间是不同的。我了解到至少这些事情起了作用:
必须有更多。也许有一些我不知道的api电话?
答案 0 :(得分:3)
有1001种获取/设置方法(但我只知道2):-D
Windows注册:
HKEY_CURRENT_USER\Control Panel\Desktop\WindowMetrics
值 IconSpacing 和 IconVerticalSpacing
代码:
using System.Management;
public string GetWinIconSpace()
{
ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\CIMV2","SELECT * FROM Win32_Desktop");
foreach (ManagementObject wmi in searcher.Get())
{
try
{
return "Desktop Icon Spacing: " + wmi.GetPropertyValue("IconSpacing").ToString();
}
catch { }
}
return "Desktop Icon Spacing: Unknown";
ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\CIMV2","SELECT * FROM Win32_Desktop");
foreach (ManagementObject wmi in searcher.Get())
{
try
{
return "Desktop Icon Spacing: " + wmi.GetPropertyValue("IconSpacing").ToString();
}
catch { }
}
return "Desktop Icon Spacing: Unknown";
和我从未尝试过的第3个人find it here
答案 1 :(得分:0)
如果图标的请求大小不可用,由于缩放算法,它们也可能是尺寸问题 (因为图标文件实际上是图标的集合,正如此帖子中关于Icons and cursors know where they came from所解释的,来自The Old New Thing)