我正在尝试制作一个datagridView以获得我从WinForms应用程序上的API收集的信息。我恢复了数字(1到5),以及一个与两个数字相关联的标准。这些数字代表I恢复标准的质量。根据编号,我显示编号的好图像。 DataGridViewImageColumn的ImageLayout属性是Zoom。
/// <summary>
/// Display on the screen, the list of criterions.
/// </summary>
private void DisplayListOfCriterion()
{
try
{
Bitmap theoretical;
Bitmap expected;
// Iterate over the dictionary
foreach (var value in dictionaryOfCriterion)
{
switch (value.Value[0])
{
case 1:
theoretical = Properties.Resources.oneStar;
break;
case 2:
theoretical = Properties.Resources.twoStar;
break;
case 3:
theoretical = Properties.Resources.threeStar;
break;
case 4:
theoretical = Properties.Resources.fourStar;
break;
case 5:
theoretical = Properties.Resources.fiveStar;
break;
default:
theoretical = Properties.Resources.oneStar;
break;
};
switch (value.Value[1])
{
case 1:
expected = Properties.Resources.oneStar;
break;
case 2:
expected = Properties.Resources.twoStar;
break;
case 3:
expected = Properties.Resources.threeStar;
break;
case 4:
expected = Properties.Resources.fourStar;
break;
case 5:
expected = Properties.Resources.fiveStar;
break;
default:
expected = Properties.Resources.oneStar;
break;
};
this.dataGrid.RowTemplate.Height = 100;
this.dataGrid.Rows.Add(value.Key.ToString(), theoretical, expected);
}
}
catch (Exception ex)
{
Log.Write(ex);
}
}
以及在Windows上的结果: Here
但是我在单声道方面有一些问题。我实际上正在使用树莓派,启动应用程序时,图像无法正确显示:Here
我不知道为什么zoom属性不会影响图像。