Form1.cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. using Azylee.Core.DataUtils.CollectionUtils;
  2. using Azylee.Core.DataUtils.GuidUtils;
  3. using Azylee.Core.DrawingUtils.ImageUtils;
  4. using Azylee.Core.IOUtils.DirUtils;
  5. using Azylee.Core.WindowsUtils.APIUtils.WallpaperUtils;
  6. using Azylee.YeahWeb.HttpUtils;
  7. using System;
  8. using System.Collections.Generic;
  9. using System.ComponentModel;
  10. using System.Data;
  11. using System.Drawing;
  12. using System.IO;
  13. using System.Linq;
  14. using System.Text;
  15. using System.Windows.Forms;
  16. namespace Test.ImageToolTest
  17. {
  18. public partial class Form1 : Form
  19. {
  20. public Form1()
  21. {
  22. InitializeComponent();
  23. }
  24. private void Form1_Load(object sender, EventArgs e)
  25. {
  26. Azylee.YeahWeb.ExtWebAPI.BingWebAPI.WallpaperUtils.WallpaperTool.GetLast10Days();
  27. List<string> file_list = new List<string>();
  28. var md = Azylee.YeahWeb.ExtWebAPI.BingWebAPI.WallpaperUtils.WallpaperTool.GetToday();
  29. var md2 = Azylee.YeahWeb.ExtWebAPI.BingWebAPI.WallpaperUtils.WallpaperTool.GetYesterday();
  30. if (md != null && Ls.Ok(md.images))
  31. {
  32. foreach (var item in md.images)
  33. {
  34. string image_url = item.GetImageUrl();
  35. string file_path = DirTool.Combine(@"F:\imgs", item.hsh + ".jpg");
  36. bool down_result = HttpTool.Download(image_url, file_path);
  37. if (down_result) file_list.Add(file_path);
  38. }
  39. }
  40. //string a = WallpaperTool.Get();
  41. //bool b = WallpaperTool.Set(@"C:\Users\yuzhengyang\Pictures\\cc.jpg");
  42. //Bitmap b1 = new Bitmap(@"F:\图片压缩测试\未标题-1.jpg");
  43. //byte[] b1_byte = IMG.Compression(b1, 30);
  44. //File.WriteAllBytes(@"F:\图片压缩测试\未标题-1(Compression).jpg", b1_byte);
  45. }
  46. }
  47. }