Foreach loop with images

前端 未结 1 1191
伪装坚强ぢ
伪装坚强ぢ 2021-01-25 09:55

I have an 80 PNG image sequence in which I am trying to create an animation for my windows app. The file path is Assets/Star/ and I am trying to figure out how I would make a fo

相关标签:
1条回答
  • 2021-01-25 10:45

    Just await Task.Delay to asynchronously wait for a set span of time:

    private async void SubmitButton_Click(object sender, RoutedEventArgs e)
    {
        if (LevelUp)
        {
            string imagePath = "Assets/Star/";
            foreach (Image image in GetImages(imagePath))
            {
                ShowImage(image);
                await Task.Delay(timeToWait);
            }
        }
    }
    
    0 讨论(0)
提交回复
热议问题