using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { //GenerationThumbnail(@"D:\02.jpg", @"D:\03.jpg", 5000, 5000, 0); uint dwWidth = 0, dwHeight = 0; float fHorizontal = 0.0F, fVertical = 0.0F; if (GetImgInfo(@"D:\02.jpg", ref dwWidth, ref dwHeight, ref fHorizontal, ref fVertical)) { Console.WriteLine("Width:" + dwWidth + ", Height:" + dwHeight ); } } [System.Runtime.InteropServices.DllImport("SimpleImgThumbnail")] public static extern bool GenerationThumbnail(string lpImgPath, string lpNewImgPath, uint dwWidth, uint dwHeight, uint uQ); [System.Runtime.InteropServices.DllImport("SimpleImgThumbnail")] public static extern bool GetImgInfo(string lpImgPath, ref uint dwWidth, ref uint dwHeight, ref float fHorizontal, ref float fVertical); } }