是否有一个在xamarin表单中绘制图像的工作示例?
将图像分配给后墙或面板都不起作用:
var backImage = new Image();
backImage.Source = ImageSource.FromUri(new Uri("http://www.steema.com/uploads/news/xamarinforms_280x210.png"));
tChart1.Walls.Back.Gradient.Visible = false;
tChart1.Walls.Back.Image = backImage;
tChart1.Panel.Gradient.Visible = false;
tChart1.Panel.Image = backImage;
而不是直接画在画布上:
void tChart1_BeforeDrawSeries(object sender, Graphics3D g)
{
Rectangle chartRect = tChart1.Chart.ChartRect;
var backImage = new Image();
backImage.Source = ImageSource.FromUri(new Uri("http://www.steema.com/uploads/news/xamarinforms_280x210.png"));
g.Draw(chartRect, chartRect, backImage, false);
}
所以我把这个添加到bug列表(bug 1299)。iOS和Android都有