gpt4 book ai didi

c# - 将图像移动到背景?

转载 作者:IT王子 更新时间:2023-10-29 03:52:43 30 4
gpt4 key购买 nike

我正在制作一个移动图像的游戏。我有两个大图像,上面应该有较小的图像。我经常将较小的图像从一个较大的图像移动到另一个。但是,我最近添加了一项功能,可以在游戏中期更改大图像。这导致它优先于较小的图像,当我移动小图像时,它们最终被移动到大图像后面。

简而言之,我总是希望大图像在背景中,小图像在前景中。有没有我可以设置的属性来实现这一点?

最佳答案

If you have more than one user interface element in a particular grid cell, the elements are layered on top of each other. Elements added earlier in XAML appear below (lower layer) than elements added later.

You can change the layering of the elements by changing the order in which they are added to the Grid. You can also control the layering by giving each element a value for Panel.ZIndex. Elements with higher values for ZIndex will appear to be on top of elements with lower values, regardless of the order in which they were added to the Grid.

来源: http://wpf.2000things.com/tag/zindex/

关于 ZIndex 属性的 MSDN 页面: http://msdn.microsoft.com/en-us/library/system.windows.controls.panel.zindex%28v=vs.110%29.aspx

关于c# - 将图像移动到背景?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25072831/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com