私は画像に問題があり、gridBg.png というアプリケーションの背景を作成し、次のように読みました。
string currentDir = Directory.GetCurrentDirectory();
if (File.Exists((currentDir + @"/Images/gridBg.png")))
{
bgAnimated.StopAnimation();
bgAnimated.GifSource = currentDir + @"/Images/gridBg.png";
bgAnimated.NormalLoopFrameCount = 20;
bgAnimated.SpecialLoopFrameCount = 20;
bgAnimated.TotalLoopFrameCount = 40;
bgAnimated.NormalLoopRepeatCount = 1;
bgAnimated.SpecialLoopRepeatCount = 1;
bgAnimated.StartAnimation();
}
デバッグモードでは、すべて正常に動作します。セットアップ プロジェクトにイメージを追加し、それにイメージ パスを指定しました。アプリケーションをインストールして試してみると、正常に動作しますが、問題は、友人の何人かが画像を表示しないことですが、画像は適切な場所 (Images フォルダー) にあります。誰かが提案していますか?
解決済み: string currentDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);