Program.cs 1.0 KB

12345678910111213141516171819202122232425262728
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. namespace ConsoleApplication1
  6. {
  7. class Program
  8. {
  9. static void Main(string[] args)
  10. {
  11. //GenerationThumbnail(@"D:\02.jpg", @"D:\03.jpg", 5000, 5000, 0);
  12. uint dwWidth = 0, dwHeight = 0;
  13. float fHorizontal = 0.0F, fVertical = 0.0F;
  14. if (GetImgInfo(@"D:\02.jpg", ref dwWidth, ref dwHeight, ref fHorizontal, ref fVertical))
  15. {
  16. Console.WriteLine("Width:" + dwWidth + ", Height:" + dwHeight );
  17. }
  18. }
  19. [System.Runtime.InteropServices.DllImport("SimpleImgThumbnail")]
  20. public static extern bool GenerationThumbnail(string lpImgPath, string lpNewImgPath, uint dwWidth, uint dwHeight, uint uQ);
  21. [System.Runtime.InteropServices.DllImport("SimpleImgThumbnail")]
  22. public static extern bool GetImgInfo(string lpImgPath, ref uint dwWidth, ref uint dwHeight, ref float fHorizontal, ref float fVertical);
  23. }
  24. }