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.
コンソール アプリケーション (フォーム アプリケーションではない) で特定の画像サイズを取得するにはどうすればよいですか? 私が見つけたほとんどの答えは、コンソールアプリケーションでは機能しないSystem.Drawingを使用しています...
プロジェクトを右クリックして参照 System.Drawing を追加し、参照を追加します。using System.Drawing;次に、.NET 全体の他の参照と同様に追加できます。
using System.Drawing;
その後、 Image クラスを使用できます
System.Drawing.Image image = System.Drawing.Image.FromFile("filePath"); Int32 w = image.Width; Int32 h = image.Height;