【发布时间】:2015-06-12 18:42:42
【问题描述】:
我正在使用 PDFsharp 导出图表图例。我正在使用 for 循环和表格来显示属性。实际上只有一个属性:细分名称。该对象具有要使用的正确 RGB 颜色。我怎样才能在它旁边绘制正方形,就像图表图例显示系列一样?请原谅我的变量名,我要举个例子。
//Writting Table Header Text
textformater.DrawString(" Color", tableheader, XBrushes.Black, snoColumn);
textformater.DrawString(" Subdivision Name", tableheader, XBrushes.Black, snoStudentName);
foreach (var item in data)
{
y = y + 30;
XRect snoColumnVal = new XRect(35, y, 70, height);
XRect snoStudentNameVal = new XRect(100, y, 250, height);
textformater.DrawString(item.Color, tableheader, XBrushes.Black, snoColumnVal);
textformater.DrawString(item.Name, tableheader, XBrushes.Black, snoStudentNameVal);
}
这是输出:
这就是我想要的样子
【问题讨论】:
-
这周我数不清有多少类似 Tile 的问题了。有一股大学/大学项目提交的恶臭......很遗憾你自己没有好好完成这个任务,谁知道你可能真的很擅长。
-
我试过了,不知道怎么动态改变物体的颜色。除非我真的需要帮助,否则我不会设置赏金