C# Windows フォーム アプリケーションの ToolStripStatusLabel 項目にアイコンを設定できるようにする必要があります。アイテムには画像とテキストが表示されます。私はそのようなアイテムでアイコンを使用できると思っていましたが、間違っています。既存の Icon オブジェクトから Image オブジェクトを作成する最良の方法は何ですか?
意図したコードは次のようになります。
Image image = new Image(); // Get this image somehow from a pre-existing Icon object
serverInfoToolStripStatusLabel.Text = "Connected to server X";
serverInfoToolStripStatusLabel.Image = image;
(注意: serverInfoToolStripStatusLabel は System.Windows.Forms.ToolStripStatusLabel として宣言されています) について。