CgImageForm.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. using DevExpress.XtraEditors;
  11. using DevExpress.XtraEditors.Repository;
  12. using XdCxRhDW.Core;
  13. using XdCxRhDW.Core.Api;
  14. namespace XdCxRhDW.App.CorTools
  15. {
  16. public partial class CgImageForm : DirectXForm// DevExpress.XtraEditors.XtraForm
  17. {
  18. public CgImageForm()
  19. {
  20. InitializeComponent();
  21. this.Font = new Font("微软雅黑", 12);
  22. }
  23. List<ImageResult> list;
  24. public CgImageForm(List<ImageResult> list)
  25. :this()
  26. {
  27. this.list= list;
  28. }
  29. private void CgImageForm_Load(object sender, EventArgs e)
  30. {
  31. directXFormContainerControl1.Location = new Point(1, 40);
  32. Bitmap bmp = new Bitmap(1024, 768);
  33. for (int x = 0; x < 1024; x++)
  34. {
  35. for (int y = 0; y < 768; y++)
  36. {
  37. var rgbb = ColorRGB.GetSpecColor(x / 1023d);
  38. int r = rgbb.R;
  39. int g = rgbb.G;
  40. int b = rgbb.B;
  41. Color c = Color.FromArgb(r, g, b);
  42. bmp.SetPixel(x, y, c);
  43. }
  44. }
  45. var edit = (RepositoryItemPictureEdit)this.pic.Edit;
  46. edit.SizeMode = DevExpress.XtraEditors.Controls.PictureSizeMode.Stretch;
  47. this.pic.EditValue= bmp;
  48. }
  49. }
  50. }