Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
透過性のある 32 ビット PNG ファイルを使用しています。それらをプロパティ付きの画像リストに追加しました:
ColorDepth: Depth32Bit TransparentColor: Transparent
画像をツールバー ボタンに割り当てると、Visual Studio で適切な透明度でプレビューされます。しかし、アプリケーションを実行すると、透明度がすべて台無しになり、半透明の領域が黒で覆われます。
これを修正するにはどうすればよいですか?
画像リストを使用せずにツールバーに直接追加すると、正しく描画されると思います。
解決策は明らかに置くことです
Application.EnableVisualStyles();
アプリケーションの開始前。これにより、透明性の問題が修正されました。
ソリューション リファレンス
EnableVisualStyles に関する MSDN