【发布时间】:2021-07-10 18:28:17
【问题描述】:
项目类型:
我的代码:
Image^ img = ref new Image();
img->Width = piece;
img->Height = piece;
Canvas::SetLeft(img, x * field + field / 2 - piece / 2);
Canvas::SetTop(img, y * field + field / 2 - piece / 2);
img->Source = ref new BitmapImage(ref new Uri("E:\\C++\\Assets\\Ball.png"));
csmain->Children->Append(img);
它不会显示存储在路径中的图像。图像甚至不可见。我没有任何线索。 我是 C++ 新手,但我非常了解 C#。
提前致谢:)
【问题讨论】:
-
Please do not post images of code because they are hard to use. 代码应作为文本直接发布在您的问题中。
-
它不是代码。它只是我在“创建新项目”中选择的图像
-
如果答案已经解决了您的问题,请mark它被接受